auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public IOMode getIOConfiguration(IOLine ioLine) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("DIO pin cannot be null."); String atCommand = ioLine.getATCommand(); ATCommandResponse response = sendATCommand(new ATCommand(atCommand)); if (response == null || response.getResponseStatus() != ATCommandStatus.OK) throw new XBeeException(XBeeException.INVALID_OPERATION); int ioModeValue = response.getResponse()[0]; IOMode dioMode = IOMode.getIOMode(ioModeValue, ioLine); if (dioMode != null) return dioMode; throw new XBeeException(XBeeException.INVALID_OPERATION); }

Target:
public IOMode getIOConfiguration(IOLine ioLine) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("DIO pin cannot be null."); ATCommandResponse response = sendATCommand(new ATCommand(ioLine.getConfigurationATCommand())); if (response == null || response.getResponseStatus() != ATCommandStatus.OK || response == null || response.getResponse().length == 0) throw new XBeeException(XBeeException.INVALID_OPERATION); int ioModeValue = response.getResponse()[0]; IOMode dioMode = IOMode.getIOMode(ioModeValue, ioLine); if (dioMode != null) return dioMode; throw new XBeeException(XBeeException.INVALID_OPERATION); }
Source:
public void install(SnapshotReader snapshotReader) { if (mClosed) { return; } if (mIgnoreApplys) { LOG.warn("Unexpected request to install a snapshot on a read-only journal state machine"); return; } long snapshotId = 0L; try (InputStream srs = new SnapshotReaderStream(snapshotReader)) { snapshotId = snapshotReader.readLong(); JournalUtils.restoreFromCheckpoint(new CheckpointInputStream(srs), getStateMachines()); } catch (Exception e) { JournalUtils.handleJournalReplayFailure(LOG, e, "Failed to install snapshot"); if (ServerConfiguration.getBoolean(PropertyKey.MASTER_JOURNAL_TOLERATE_CORRUPTION)) { return; } } if (snapshotId < mNextSequenceNumberToRead - 1) { LOG.warn("Installed snapshot for SN but next SN to read is {}", snapshotId, mNextSequenceNumberToRead); } mNextSequenceNumberToRead = snapshotId + 1; LOG.info("Successfully installed snapshot up to SN {}", snapshotId); }

Target:
public void install(SnapshotReader snapshotReader) { if (mClosed) { return; } if (mIgnoreApplys) { LOG.warn("Unexpected request to install a snapshot on a read-only journal state machine"); return; } long snapshotId = 0L; try (InputStream srs = new SnapshotReaderStream(snapshotReader)) { snapshotId = snapshotReader.readLong(); JournalUtils.restoreFromCheckpoint(new CheckpointInputStream(srs), getStateMachines()); } catch (Exception e) { JournalUtils.handleJournalReplayFailure(LOG, e, "Failed to install snapshot: %s", snapshotId); if (ServerConfiguration.getBoolean(PropertyKey.MASTER_JOURNAL_TOLERATE_CORRUPTION)) { return; } } if (snapshotId < mNextSequenceNumberToRead - 1) { LOG.warn("Installed snapshot for SN but next SN to read is {}", snapshotId, mNextSequenceNumberToRead); } mNextSequenceNumberToRead = snapshotId + 1; LOG.info("Successfully installed snapshot up to SN {}", snapshotId); }
Source:
public BinderTypeRegistry binderTypeRegistry() { BinderType bt = new BinderType(NAME, new Class[] {SpringIntegrationBinderConfiguration.class}); Map<String, BinderType> binderTypes = new HashMap<>(); binderTypes.put(NAME, bt); BinderTypeRegistry btr = new DefaultBinderTypeRegistry(binderTypes); return btr; }

Target:
public BinderTypeRegistry binderTypeRegistry() { BinderType binderType = new BinderType(NAME, new Class[] {SpringIntegrationBinderConfiguration.class}); BinderTypeRegistry btr = new DefaultBinderTypeRegistry(Collections.singletonMap(NAME, binderType)); return btr; }
Source:
public void setupLocalServerAdapter() { NewServerWizard serverW = new NewServerWizard(); try { serverW.open(); NewServerWizardPage sp = new NewServerWizardPage(serverW); sp.selectType(getFamily(server), server); serverW.next(); NewServerAdapterPage ap = new NewServerAdapterPage(serverW); ap.setRuntime(null); ap.checkErrors(); serverW.next(); setupRuntime(serverW); serverW.finish(); } catch (AssertionError | RuntimeException e) { try { serverW.cancel(); } catch (RedDeerException ex) { throw ex; } throw e; } }

Target:
public void setupLocalServerAdapter() { NewServerWizard serverW = new NewServerWizard(); try { serverW.open(); NewServerWizardPage sp = new NewServerWizardPage(serverW); sp.selectType(getFamily(server), server); serverW.next(); NewServerAdapterPage ap = new NewServerAdapterPage(serverW); ap.setRuntime(null); ap.checkErrors(); serverW.next(); setupRuntime(serverW); serverW.finish(); } catch (AssertionError | RuntimeException e) { try { serverW.cancel(); } catch (RedDeerException ex) { LOGGER.error("Cannot close server wizard!", ex); } throw e; } }
Source:
public static boolean setOptionInCDT(IProject project, String optionIDString, boolean value, String parentToolName) { IConfiguration activeConf = helperGetActiveConfiguration(project); ITool gccCompileriTool = helperGetGccCompilerTool(parentToolName, activeConf); IOption optionTemplate = gccCompileriTool.getOptionById(optionIDString); if (optionTemplate == null) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetOptionTemplate); return false; } IOption mutableOptionToSet = null; try { mutableOptionToSet = gccCompileriTool.getOptionToSet(optionTemplate, false); mutableOptionToSet.setValue(value); } catch (BuildException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetOptionForWriting); } IResourceInfo resourceInfos[] = activeConf.getResourceInfos(); IResourceInfo resourceInfo = resourceInfos[0]; ManagedBuildManager.setOption(resourceInfo, gccCompileriTool, mutableOptionToSet, true); ManagedBuildManager.saveBuildInfo(project, true); return true; }

Target:
public static boolean setOptionInCDT(IProject project, String optionIDString, boolean value, String parentToolName) { IConfiguration activeConf = helperGetActiveConfiguration(project); ITool gccCompileriTool = helperGetGccCompilerTool(parentToolName, activeConf); IOption optionTemplate = gccCompileriTool.getOptionById(optionIDString); if (optionTemplate == null) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetOptionTemplate); return false; } IOption mutableOptionToSet = null; try { mutableOptionToSet = gccCompileriTool.getOptionToSet(optionTemplate, false); mutableOptionToSet.setValue(value); } catch (BuildException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetOptionForWriting); } IResourceInfo resourceInfo = activeConf.getResourceInfos()[0]; ManagedBuildManager.setOption(resourceInfo, gccCompileriTool, mutableOptionToSet, true); ManagedBuildManager.saveBuildInfo(project, true); return true; }
Source:
public void testIsEmpty() { assertTrue(StringHelper.isEmpty(null)); assertTrue(StringHelper.isEmpty(StringHelper.EMPTY)); assertFalse(StringHelper.isEmpty("test")); }

Target:
public void testIsEmpty() { assertTrue(StringHelper.isEmpty(null)); assertTrue(StringHelper.isEmpty("")); assertFalse(StringHelper.isEmpty("test")); assertFalse(StringHelper.isEmpty(" ")); }
Source:
protected boolean isValidConnection(StorageServerConnections conn) { StorageType storageType = conn.getStorageType(); if (storageType == StorageType.NFS && (!new NfsMountPointConstraint().isValid(conn.getConnection(), null) || StringUtils.containsAny(conn.getConnection(), " "))) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID); } if (storageType == StorageType.POSIXFS && StringUtils.isEmpty(conn.getVfsType())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if ((storageType == StorageType.POSIXFS || storageType == StorageType.NFS) && !validate(validateMountOptions())) { return false; } if (storageType == StorageType.ISCSI) { if (StringUtils.isEmpty(conn.getIqn())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_IQN); } if (!isValidStorageConnectionPort(conn.getPort())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID_PORT); } } if (storageType == StorageType.GLUSTERFS) { StorageConnectionValidator validator = new StorageConnectionValidator(conn); if (!validate(validator.canVDSConnectToGlusterfs(getVds()))) { return false; } } if (checkIsConnectionFieldEmpty(conn)) { return false; } return true; }

Target:
protected boolean isValidConnection(StorageServerConnections conn) { StorageType storageType = conn.getStorageType(); if (storageType == StorageType.NFS && !new NfsMountPointConstraint().isValid(conn.getConnection(), null)) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID); } if (storageType == StorageType.POSIXFS && StringUtils.isEmpty(conn.getVfsType())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if ((storageType == StorageType.POSIXFS || storageType == StorageType.NFS) && !validate(validateMountOptions())) { return false; } if (storageType == StorageType.ISCSI) { if (StringUtils.isEmpty(conn.getIqn())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_IQN); } if (!isValidStorageConnectionPort(conn.getPort())) { return failValidation(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID_PORT); } } if (storageType == StorageType.GLUSTERFS) { StorageConnectionValidator validator = new StorageConnectionValidator(conn); if (!validate(validator.canVDSConnectToGlusterfs(getVds()))) { return false; } } if (checkIsConnectionFieldEmpty(conn)) { return false; } return true; }
Source:
private int addSingleSPA(Entity entity, double xpCap) { int unitType = entity.getUnitType(); List<SpecialAbility> choices = coalescedSPAList(unitType, xpCap); if (choices.size() == 0) { return 0; } int spaIndex; SpecialAbility spa = null; while (choices.size() > 0) { spaIndex = Compute.randomInt(choices.size()); spa = choices.get(spaIndex); if (entity.hasAbility(spa.getName()) || !extraEligibilityCheck(spa, entity)) { choices.remove(spaIndex); spa = null; } else { break; } } if (spa == null) { return 0; } String spaValue; switch (spa.getName()) { case OptionsConstants.MISC_HUMAN_TRO: spaValue = pickRandomHumanTRO(); break; case OptionsConstants.GUNNERY_RANGE_MASTER: spaValue = pickRandomRangeMaster(); break; case OptionsConstants.GUNNERY_SPECIALIST: spaValue = pickRandomGunnerySpecialization(entity); break; case OptionsConstants.GUNNERY_WEAPON_SPECIALIST: spaValue = pickRandomWeapon(entity, false); break; case OptionsConstants.GUNNERY_SANDBLASTER: spaValue = pickRandomWeapon(entity, true); break; default: entity.getCrew().getOptions().getOption(spa.getName()).setValue(true); return spa.getCost(); } if (spaValue.equals(Crew.SPECIAL_NONE)) { return 0; } entity.getCrew().getOptions().getOption(spa.getName()).setValue(spaValue); return spa.getCost(); }

Target:
private int addSingleSPA(Entity entity, double xpCap) { int unitType = entity.getUnitType(); List<SpecialAbility> choices = coalescedSPAList(unitType, xpCap); if (choices.size() == 0) { return 0; } while (choices.size() > 0) { int spaIndex = Compute.randomInt(choices.size()); SpecialAbility spa = choices.get(spaIndex); if (entity.hasAbility(spa.getName()) || !extraEligibilityCheck(spa, entity)) { choices.remove(spaIndex); } else { String spaValue; switch (spa.getName()) { case OptionsConstants.MISC_HUMAN_TRO: spaValue = pickRandomHumanTRO(); break; case OptionsConstants.GUNNERY_RANGE_MASTER: spaValue = pickRandomRangeMaster(); break; case OptionsConstants.GUNNERY_SPECIALIST: spaValue = pickRandomGunnerySpecialization(entity); break; case OptionsConstants.GUNNERY_WEAPON_SPECIALIST: spaValue = pickRandomWeapon(entity, false); break; case OptionsConstants.GUNNERY_SANDBLASTER: spaValue = pickRandomWeapon(entity, true); break; default: entity.getCrew().getOptions().getOption(spa.getName()).setValue(true); return spa.getCost(); } if (!spaValue.equals(Crew.SPECIAL_NONE)) { entity.getCrew().getOptions().getOption(spa.getName()).setValue(spaValue); return spa.getCost(); } } } return 0; }
Source:
public void setUp() { objectMapper = new ObjectMapper(); mockMvc = MockMvcBuilders.standaloneSetup(controllersUnderTest()) .setViewResolvers(viewResolver()) .setControllerAdvice(new GlobalControllerExceptionHandler()) .setHandlerExceptionResolvers(uncheckedExceptionResolver()) .build(); }

Target:
public void setUp() { objectMapper = new ObjectMapper(); mockMvc = MockMvcBuilders.standaloneSetup(controllersUnderTest()) .setViewResolvers(viewResolver()) .setControllerAdvice(controllerAdvice()) .setHandlerExceptionResolvers(uncheckedExceptionResolver()) .build(); }
Source:
private PatchSet getBasePatchSet(Change change, Ref ref) throws IOException, InvalidChangeOperationException { try { int pos = ref.getName().lastIndexOf("/"); String psId = ref.getName().substring(pos + 1); return db.get().patchSets().get(new PatchSet.Id( change.getId(), Integer.valueOf(psId))); } catch (OrmException e) { throw new IOException(e); } }

Target:
private PatchSet getBasePatchSet(Change change, Ref ref) throws IOException, InvalidChangeOperationException { try { int pos = ref.getName().lastIndexOf("/"); checkArgument(pos >0, "invalid edit ref: %s", ref.getName()); String psId = ref.getName().substring(pos + 1); return db.get().patchSets().get(new PatchSet.Id( change.getId(), Integer.valueOf(psId))); } catch (OrmException e) { throw new IOException(e); } }
Source:
public CategoryView findCategoryWithoutCache(CategoryView parentCategoryView, String category) { if(parentCategoryView.getName().toLowerCase().equals(category.toLowerCase())) { return parentCategoryView; } for(String key : parentCategoryView.getChildren().keySet()) { CategoryView categoryView = findCategoryWithoutCache(parentCategoryView.getChild(key), category); if(categoryView != null) { return categoryView; } } return null; }

Target:
public CategoryView findCategoryWithoutCache(CategoryView parentCategoryView, String category) { if(parentCategoryView.getName().equalsIgnoreCase(category)) { return parentCategoryView; } return parentCategoryView.getChildren().values().stream() .map((CategoryView child) -> findCategoryWithoutCache(child, category)) .filter(Objects::nonNull).findAny().orElse(null); }
Source:
public void onTraversalStart() { try { outputStream = outputFile != null ? new PrintStream(outputFile) : System.out; } catch ( final FileNotFoundException e ) { throw new UserException.CouldNotReadInputFile(outputFile, e); } List<SimpleInterval> intervals = intervalArgumentCollection.getIntervals(getReferenceDictionary()); targetTerriroty = intervals.stream().mapToInt(i -> i.size()).sum(); id = FilenameUtils.getBaseName(drivingVariantFile); }

Target:
public void onTraversalStart() { id = FilenameUtils.getBaseName(drivingVariantFile); }
Source:
private void assertAllHBaseRowsHaveEmptyColumnCell(byte[] hbaseTableName, byte[] emptyColumnFamilyName, byte[] emptyColumnName, long minTimestamp, int expectedRows) throws IOException, SQLException { try (Table tbl = driver.getConnectionQueryServices(getUrl(), TestUtil.TEST_PROPERTIES) .getTable(hbaseTableName)) { Scan allRows = new Scan(); allRows.setMaxVersions(1); allRows.setTimeRange(minTimestamp, minTimestamp + Integer.MAX_VALUE); ResultScanner scanner = tbl.getScanner(allRows); int numMatchingRows = 0; for (Result result = scanner.next(); result != null; result = scanner.next()) { numMatchingRows += result.containsColumn(emptyColumnFamilyName, emptyColumnName) ? 1 : 0; } assertEquals(String.format( "Expected rows do match for table = %s at timestamp %d", Bytes.toString(hbaseTableName), minTimestamp), expectedRows, numMatchingRows); } }

Target:
private void assertAllHBaseRowsHaveEmptyColumnCell(byte[] hbaseTableName, byte[] emptyColumnFamilyName, byte[] emptyColumnName, long minTimestamp, int expectedRows) throws IOException, SQLException { try (Table tbl = driver.getConnectionQueryServices(getUrl(), TestUtil.TEST_PROPERTIES) .getTable(hbaseTableName)) { Scan allRows = new Scan(); allRows.setTimeRange(minTimestamp, minTimestamp + Integer.MAX_VALUE); ResultScanner scanner = tbl.getScanner(allRows); int numMatchingRows = getNumRowsWithEmptyColumnAndMaxTimestamp(scanner, emptyColumnFamilyName, emptyColumnName); assertEquals(String.format("Expected rows do match for table = %s at timestamp %d", Bytes.toString(hbaseTableName), minTimestamp), expectedRows, numMatchingRows); } }
Source:
private void setUpFlushTask() { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat("event-logger-flush-%d") .build(); flushScheduler = Executors.newSingleThreadScheduledExecutor(threadFactory); Runnable runnable = new Runnable() { @Override public void run() { try { if (dirty) { eventLogWriter.flush(); dirty = false; } } catch (IOException ex) { LOG.error("Error flushing " + eventLogPath, ex); throw new RuntimeException(ex); } } }; flushScheduler.scheduleAtFixedRate(runnable, FLUSH_INTERVAL_MILLIS, FLUSH_INTERVAL_MILLIS, TimeUnit.MILLISECONDS); }

Target:
private void setUpFlushTask() { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat("event-logger-flush-%d") .setDaemon(true) .build(); flushScheduler = Executors.newSingleThreadScheduledExecutor(threadFactory); Runnable runnable = new Runnable() { @Override public void run() { try { if (dirty) { eventLogWriter.flush(); dirty = false; } } catch (IOException ex) { LOG.error("Error flushing " + eventLogPath, ex); throw new RuntimeException(ex); } } }; flushScheduler.scheduleAtFixedRate(runnable, FLUSH_INTERVAL_MILLIS, FLUSH_INTERVAL_MILLIS, TimeUnit.MILLISECONDS); }
Source:
public String fetchRandomGeneIdFromAnalytics(AnalyticsSchemaField field, String term) { SolrQueryBuilder<AnalyticsCollectionProxy> queryBuilder = new SolrQueryBuilder<>(); queryBuilder .addQueryFieldByTerm(field, term) .setFieldList(AnalyticsCollectionProxy.BIOENTITY_IDENTIFIER) .setRows(MAX_ROWS); return analyticsCollectionProxy .query(queryBuilder) .getResults() .get(RNG.nextInt(MAX_ROWS)) .getFieldValue("bioentity_identifier") .toString(); }

Target:
public String fetchRandomGeneIdFromAnalytics(AnalyticsSchemaField field, String term) { SolrQueryBuilder<AnalyticsCollectionProxy> queryBuilder = new SolrQueryBuilder<>(); queryBuilder .addQueryFieldByTerm(field, term) .setFieldList(AnalyticsCollectionProxy.BIOENTITY_IDENTIFIER) .setRows(MAX_ROWS); return getRandomSolrDocument(analyticsCollectionProxy.query(queryBuilder).getResults()) .getFieldValue("bioentity_identifier") .toString(); }
Source:
public List<String> getPrimaryFromClauseTables() { return (List<String>) joins.values() .stream() .map( elem -> ((JoinSequence) elem).getFromPart().getFirstJoin().getJoinable().getTableName() ). collect( Collectors.toList() ); }

Target:
public List<String> getPrimaryFromClauseTables() { throw new UnsupportedOperationException( "The classic mode does not support UPDATE statements via createQuery!" ); }
Source:
private void updateCurrentMemory(int newAmountOfMemory) { int currentMemory = getVm().getMemSizeMb(); if (getVm().getStatus().isNotRunning()) { newVmStatic.setMemSizeMb(newAmountOfMemory); return; } if (getVm().getStatus() != VMStatus.Up) { newVmStatic.setMemSizeMb(currentMemory); log.warn("Memory update {}MB -> {}MB of VM ({}) left out. Memory can't be updated in current state VM ({}).", currentMemory, newAmountOfMemory, getVm().getName(), getVm().getId(), getVm().getStatus()); return; } if (currentMemory != newAmountOfMemory) { hotSetMemory(newAmountOfMemory); } }

Target:
private void updateCurrentMemory(int newAmountOfMemory) { int currentMemory = getVm().getMemSizeMb(); if (getVm().getStatus().isNotRunning()) { newVmStatic.setMemSizeMb(newAmountOfMemory); return; } if (getVm().getStatus() != VMStatus.Up) { newVmStatic.setMemSizeMb(currentMemory); log.warn("Memory update {}MB -> {}MB of VM ({}) left out. Memory can't be updated in current VM state ({}).", currentMemory, newAmountOfMemory, getVm().getName(), getVm().getId(), getVm().getStatus()); return; } if (currentMemory != newAmountOfMemory) { hotSetMemory(newAmountOfMemory); } }
Source:
private void checkRefresh() { if (delegate == null || !requiresRefresh() || updateRunnable != null) { return; } updateRunnable = new Runnable() { @Override public void run() { CountingChannel toClose = null; WriteLock writeLock = null; try { CountingChannel newChannel = new CountingChannel(factory.create()); writeLock = delegateLock.writeLock(); writeLock.lock(); if (delegate != null && requiresRefresh()) { toClose = delegate; delegate = newChannel; nextRefresh = calculateNewRefreshTime(); } else { toClose = newChannel; } } finally { updateRunnable = null; if (toClose != null) { closingAsynchronously.incrementAndGet(); } if (writeLock != null) { writeLock.unlock(); } try { toClose.close(); } catch (IOException e) { log.log(Level.WARNING, "Could not close a recycled delegate", e); } catch (InterruptedException e) { Thread.interrupted(); } finally { synchronized (closingAsynchronously) { if (closingAsynchronously.decrementAndGet() == 0) { closingAsynchronously.notify(); } } } } } }; executor.execute(updateRunnable); }

Target:
private void checkRefresh() { if (requiresUpdate()) { synchronized (this) { if (requiresUpdate()) { currentlyUpdating.set(true); executor.execute(updater); } } } }
Source:
public void dynamicallyConvertExternalToManagedTable() throws Throwable { primary.run("use " + primaryDbName) .run("create external table t1 (id int) stored as orc") .run("insert into table t1 values (1)") .run("create external table t2 (place string) partitioned by (country string)") .run("insert into table t2 partition(country='india') values ('bangalore')") .runFailure("alter table t1 set tblproperties('EXTERNAL'='false')") .runFailure("alter table t2 set tblproperties('EXTERNAL'='false')"); }

Target:
public void dynamicallyConvertExternalToManagedTable() throws Throwable { primary.run("use " + primaryDbName) .run("create external table t1 (id int) stored as orc") .run("insert into table t1 values (1)") .run("create external table t2 (place string) partitioned by (country string)") .run("insert into table t2 partition(country='india') values ('bangalore')") .runFailure("alter table t1 set tblproperties('EXTERNAL'='false')") .runFailure("alter table t1 set tblproperties('EXTERNAL'='false', 'TRANSACTIONAL'='true')") .runFailure("alter table t2 set tblproperties('EXTERNAL'='false')"); }
Source:
public Object[] getChildren(Object parentElement) { if (parentElement instanceof IFeatureModel) { IFeatureModel featureModel = (IFeatureModel) parentElement; Object[] features = featureModel.getFeature().getIncludedFeatures(); if (!input.isIncludePlugins()) { return features; } Object[] plugins = featureModel.getFeature().getPlugins(); Object[] all = new Object[features.length + plugins.length]; System.arraycopy(features, 0, all, 0, features.length); System.arraycopy(plugins, 0, all, features.length, plugins.length); return all; } else if (parentElement instanceof IFeatureChild) { IFeatureChild featureChild = (IFeatureChild) parentElement; IFeatureModel featureModel = featureModelManager.findFeatureModel(featureChild.getId()); return getChildren(featureModel); } return new Object[0]; }

Target:
public Object[] getChildren(Object parentElement) { if (parentElement instanceof IFeatureModel) { IFeatureModel featureModel = (IFeatureModel) parentElement; Object[] features = featureModel.getFeature().getIncludedFeatures(); if (!fInput.isIncludePlugins()) { return features; } Object[] plugins = featureModel.getFeature().getPlugins(); Object[] all = new Object[features.length + plugins.length]; System.arraycopy(features, 0, all, 0, features.length); System.arraycopy(plugins, 0, all, features.length, plugins.length); return all; } else if (parentElement instanceof IFeatureChild) { IFeatureChild featureChild = (IFeatureChild) parentElement; IFeatureModel featureModel = fFeatureModelManager.findFeatureModel(featureChild.getId()); return getChildren(featureModel); } return new Object[0]; }
Source:
public void save() { try { Preferences accountsNode = AccountModel.getAccountsPreferences(); Preferences clusterNode = accountsNode.node(getId()); ISecurePreferences clusterSecureNode = AccountModel.getSecureAccountsPreferences().node(getId()); clusterNode.put(ENDPOINT_URL_KEY, getEndpointURL()); removed.stream().forEach(id -> { try { clusterNode.node(id).removeNode(); clusterSecureNode.node(id).removeNode(); } catch (BackingStoreException e) { OpenShiftIOCoreActivator.logError(e.getLocalizedMessage(), e); } }); removed.clear(); clusterNode.flush(); clusterSecureNode.flush(); } catch (BackingStoreException | IOException e) { OpenShiftIOCoreActivator.logError("Error saving cluster in storage", e); } }

Target:
public void save() { try { Preferences accountsNode = AccountModel.getAccountsPreferences(); Preferences clusterNode = accountsNode.node(getId()); ISecurePreferences clusterSecureNode = AccountModel.getSecureAccountsPreferences().node(getId()); clusterNode.put(ENDPOINT_URL_KEY, getEndpointURL()); removed.forEach(id -> { try { clusterNode.node(id).removeNode(); clusterSecureNode.node(id).removeNode(); } catch (BackingStoreException e) { OpenShiftIOCoreActivator.logError(e.getLocalizedMessage(), e); } }); removed.clear(); clusterNode.flush(); clusterSecureNode.flush(); } catch (BackingStoreException | IOException e) { OpenShiftIOCoreActivator.logError("Error saving cluster in storage", e); } }
Source:
public ExchangeContext(boolean crd, GridDhtPartitionsExchangeFuture fut) { int protocolVer = exchangeProtocolVersion(fut.firstEventCache().minimumNodeVersion()); if (getBoolean(IGNITE_PME_EXCHANGE_FREE, true) && !compatibilityNode && fut.wasRebalanced() && fut.isBaselineNodeFailed() && allNodesSupports(fut.firstEventCache().allNodes(), PME_FREE_SWITCH)) { exchangeFreeSwitch = true; merge = false; } else if (compatibilityNode || (crd && fut.localJoinExchange())) { fetchAffOnJoin = true; merge = false; } else { boolean startCaches = fut.exchangeId().isJoined() && fut.sharedContext().cache().hasCachesReceivedFromJoin(fut.exchangeId().eventNode()); fetchAffOnJoin = protocolVer == 1; merge = !startCaches && protocolVer > 1 && fut.firstEvent().type() != EVT_DISCOVERY_CUSTOM_EVT; } evts = new ExchangeDiscoveryEvents(fut); }

Target:
public ExchangeContext(boolean crd, GridDhtPartitionsExchangeFuture fut) { int protocolVer = exchangeProtocolVersion(fut.firstEventCache().minimumNodeVersion()); boolean allNodesSupportsPmeFreeSwitch = allNodesSupports(fut.firstEventCache().allNodes(), PME_FREE_SWITCH); if (!allNodesSupportsPmeFreeSwitch) fut.logger().warning("Current topology does not support the PME-free switch, " + "may be you use different versions Apache Ignite or the feature is explicitly disabled " + "by JVM option IGNITE_PME_FREE_SWITCH_DISABLED on some nodes."); if (!compatibilityNode && fut.wasRebalanced() && fut.isBaselineNodeFailed() && allNodesSupportsPmeFreeSwitch) { exchangeFreeSwitch = true; merge = false; } else if (compatibilityNode || (crd && fut.localJoinExchange())) { fetchAffOnJoin = true; merge = false; } else { boolean startCaches = fut.exchangeId().isJoined() && fut.sharedContext().cache().hasCachesReceivedFromJoin(fut.exchangeId().eventNode()); fetchAffOnJoin = protocolVer == 1; merge = !startCaches && protocolVer > 1 && fut.firstEvent().type() != EVT_DISCOVERY_CUSTOM_EVT; } evts = new ExchangeDiscoveryEvents(fut); }
Source:
public static Calendar dateToCalendar(Date date) { Calendar calendar = Calendar.getInstance( ENCODING_TIME_ZONE, Locale.ROOT ); calendar.setTime( date ); return calendar; }

Target:
public static Calendar dateToCalendar(Date date) { Calendar calendar = Calendar.getInstance( ENCODING_TIME_ZONE, Locale.ENGLISH ); calendar.setTime( date ); return calendar; }
Source:
private static String toYAML(Entrypoint ep) { try { return new YAMLMapper().writer().writeValueAsString(ep); } catch (JsonProcessingException e) { throw new IllegalStateException("Could not serialize entrypoint to YAML. This is a bug.", e); } }

Target:
private static String toYAML(Entrypoint ep) throws DevfileException { return Serialization.asYaml(ep); }
Source:
default <R> Future<R> collect(PartialFunction<? super T, ? extends R> partialFunction) { Objects.requireNonNull(partialFunction, "partialFunction is null"); final Promise<R> promise = Promise.make(executorService()); onComplete((Try<T> result) -> promise.complete(result.collect(partialFunction))); return promise.future(); }

Target:
default <R> Future<R> collect(PartialFunction<? super T, ? extends R> partialFunction) { Objects.requireNonNull(partialFunction, "partialFunction is null"); final Promise<R> promise = Promise.make(executorService()); onComplete(result -> promise.complete(result.collect(partialFunction))); return promise.future(); }
Source:
public QueryRunner<SegmentAnalysis> createRunner(final Segment segment) { return new QueryRunner<SegmentAnalysis>() { @Override public Sequence<SegmentAnalysis> run(Query<SegmentAnalysis> inQ, Map<String, Object> responseContext) { SegmentMetadataQuery query = (SegmentMetadataQuery) inQ; final QueryableIndex index = segment.asQueryableIndex(); final Map<String, ColumnAnalysis> analyzedColumns; long totalSize = 0; int numRows = 0; if (index == null) { StorageAdapter segmentAdapter = segment.asStorageAdapter(); analyzedColumns = analyzer.analyze(segmentAdapter, query.getAnalysisTypes()); numRows = segmentAdapter.getNumRows(); } else { analyzedColumns = analyzer.analyze(index, query.getAnalysisTypes()); numRows = index.getNumRows(); } if (query.hasSize()) { totalSize = analyzedColumns.size() * numRows; } Map<String, ColumnAnalysis> columns = Maps.newTreeMap(); ColumnIncluderator includerator = query.getToInclude(); for (Map.Entry<String, ColumnAnalysis> entry : analyzedColumns.entrySet()) { final String columnName = entry.getKey(); final ColumnAnalysis column = entry.getValue(); if (!column.isError()) { totalSize += column.getSize(); } if (includerator.include(columnName)) { columns.put(columnName, column); } } return Sequences.simple( Arrays.asList( new SegmentAnalysis( segment.getIdentifier(), Arrays.asList(segment.getDataInterval()), columns, totalSize ) ) ); } }; }

Target:
public QueryRunner<SegmentAnalysis> createRunner(final Segment segment) { return new QueryRunner<SegmentAnalysis>() { @Override public Sequence<SegmentAnalysis> run(Query<SegmentAnalysis> inQ, Map<String, Object> responseContext) { SegmentMetadataQuery query = (SegmentMetadataQuery) inQ; final QueryableIndex index = segment.asQueryableIndex(); final Map<String, ColumnAnalysis> analyzedColumns; final int numRows; long totalSize = 0; if (index == null) { StorageAdapter segmentAdapter = segment.asStorageAdapter(); analyzedColumns = analyzer.analyze(segmentAdapter, query.getAnalysisTypes()); numRows = segmentAdapter.getNumRows(); } else { analyzedColumns = analyzer.analyze(index, query.getAnalysisTypes()); numRows = index.getNumRows(); } if (query.hasSize()) { totalSize = analyzedColumns.size() * numRows; } Map<String, ColumnAnalysis> columns = Maps.newTreeMap(); ColumnIncluderator includerator = query.getToInclude(); for (Map.Entry<String, ColumnAnalysis> entry : analyzedColumns.entrySet()) { final String columnName = entry.getKey(); final ColumnAnalysis column = entry.getValue(); if (!column.isError()) { totalSize += column.getSize(); } if (includerator.include(columnName)) { columns.put(columnName, column); } } return Sequences.simple( Arrays.asList( new SegmentAnalysis( segment.getIdentifier(), Arrays.asList(segment.getDataInterval()), columns, totalSize ) ) ); } }; }
Source:
void refreshTokenWithoutCache(final String refreshToken, final AuthenticationRequest authenticationRequest, final AuthenticationCallback<AuthenticationResult> externalCallback) { Logger.setCorrelationId(authenticationRequest.getCorrelationId()); Logger.v(TAG, "Refresh token without cache"); final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), externalCallback); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { try { validateAcquireTokenRequest(authenticationRequest); final AcquireTokenSilentHandler acquireTokenSilentHandler = new AcquireTokenSilentHandler(mContext, authenticationRequest, mTokenCacheAccessor); if(mAuthContext.getExtendedLifetimeEnabled()) { acquireTokenSilentHandler.setOutageModeIsOn(true); } final AuthenticationResult authResult = acquireTokenSilentHandler.acquireTokenWithRefreshToken(refreshToken); callbackHandle.onSuccess(authResult); } catch (final AuthenticationException authenticationException) { callbackHandle.onError(authenticationException); } } }); }

Target:
void refreshTokenWithoutCache(final String refreshToken, final AuthenticationRequest authenticationRequest, final AuthenticationCallback<AuthenticationResult> externalCallback) { Logger.setCorrelationId(authenticationRequest.getCorrelationId()); Logger.v(TAG, "Refresh token without cache"); final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), externalCallback); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { try { validateAcquireTokenRequest(authenticationRequest); final AcquireTokenSilentHandler acquireTokenSilentHandler = new AcquireTokenSilentHandler(mContext, authenticationRequest, mTokenCacheAccessor); final AuthenticationResult authResult = acquireTokenSilentHandler.acquireTokenWithRefreshToken(refreshToken); callbackHandle.onSuccess(authResult); } catch (final AuthenticationException authenticationException) { callbackHandle.onError(authenticationException); } } }); }
Source:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(jobs); for (String job_s: hs) { AbstractItem job = null; try { job = (AbstractItem) jenkins.getItemByFullName(job_s); if(job == null) { stderr.format("No such job '%s'\n", job_s); errorOccurred = true; continue; } try { job.checkPermission(AbstractItem.DELETE); } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } job.delete(); } catch (Exception e) { stderr.format("Unexpected exception occurred during deletion of job '%s': %s\n", job == null ? "(null)" : job.getFullName(), e.getMessage() ); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }

Target:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(jobs); for (String job_s: hs) { AbstractItem job = null; try { job = (AbstractItem) jenkins.getItemByFullName(job_s); if(job == null) { stderr.format("No such job '%s'\n", job_s); errorOccurred = true; continue; } try { job.checkPermission(AbstractItem.DELETE); } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } job.delete(); } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of job '%s': %s", job == null ? "(null)" : job.getFullName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? -1 : 0; }
Source:
public void startSharing(StreamProcessor processor, IClientManager cm, Client c, Optional<StreamDesc> osd, JSONObject msg, Activity a) { StreamDesc sd; KurentoHandler h = processor.getHandler(); if (sharingStarted.compareAndSet(false, true)) { sharingUser.put("sid", c.getSid()); sd = c.addStream(StreamType.SCREEN, a); sd.setWidth(msg.getInt("width")).setHeight(msg.getInt("height")); cm.update(c); log.debug("User {}: has started sharing, with stream: {}", sd.getUid(), a); h.sendClient(sd.getSid(), newKurentoMsg() .put("id", "broadcast") .put("stream", sd.toJson() .put("shareType", msg.getString("shareType")) .put("fps", msg.getString("fps"))) .put(PARAM_ICE, h.getTurnServers())); } else if (osd.isPresent() && !osd.get().hasActivity(a)) { sd = osd.get(); sd.addActivity(a); cm.update(c); h.sendShareUpdated(sd); WebSocketHelper.sendRoom(new TextRoomMessage(c.getRoomId(), c, RoomMessage.Type.RIGHT_UPDATED, c.getUid())); WebSocketHelper.sendRoomOthers(roomId, c.getUid(), newKurentoMsg() .put("id", "newStream") .put(PARAM_ICE, processor.getHandler().getTurnServers()) .put("stream", sd.toJson())); } }

Target:
public void startSharing(StreamProcessor processor, IClientManager cm, Client c, Optional<StreamDesc> osd, JSONObject msg, Activity a) { StreamDesc sd; KurentoHandler h = processor.getHandler(); if (sharingStarted.compareAndSet(false, true)) { sharingUser.put("sid", c.getSid()); sd = c.addStream(StreamType.SCREEN, a); sd.setWidth(msg.getInt("width")).setHeight(msg.getInt("height")); cm.update(c); log.debug("Stream.UID {}: sharing has been started, activity: {}", sd.getUid(), a); h.sendClient(sd.getSid(), newKurentoMsg() .put("id", "broadcast") .put("stream", sd.toJson() .put("shareType", msg.getString("shareType")) .put("fps", msg.getString("fps"))) .put(PARAM_ICE, h.getTurnServers())); } else if (osd.isPresent() && !osd.get().hasActivity(a)) { sd = osd.get(); sd.addActivity(a); cm.update(c); h.sendShareUpdated(sd); WebSocketHelper.sendRoom(new TextRoomMessage(c.getRoomId(), c, RoomMessage.Type.RIGHT_UPDATED, c.getUid())); WebSocketHelper.sendRoomOthers(roomId, c.getUid(), newKurentoMsg() .put("id", "newStream") .put(PARAM_ICE, processor.getHandler().getTurnServers()) .put("stream", sd.toJson())); } }
Source:
public Dialog onCreateDialog(Bundle savedInstanceState) { @SuppressLint("InflateParams") View view = LayoutInflater.from(getActivity()).inflate(R.layout.crypto_settings_dialog, null); cryptoStatusSelector = (CryptoStatusSelector) view.findViewById(R.id.crypto_status_selector); cryptoStatusText = (LinearViewAnimator) view.findViewById(R.id.crypto_status_text); cryptoStatusSelector.setCryptoStatusListener(this); Bundle arguments = savedInstanceState != null ? savedInstanceState : getArguments(); currentMode = CryptoMode.valueOf(arguments.getString(ARG_CURRENT_MODE)); updateView(false); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(view); builder.setPositiveButton("Proceed", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); return builder.create(); }

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { @SuppressLint("InflateParams") View view = LayoutInflater.from(getActivity()).inflate(R.layout.crypto_settings_dialog, null); cryptoModeSelector = (CryptoModeSelector) view.findViewById(R.id.crypto_status_selector); cryptoStatusText = (LinearViewAnimator) view.findViewById(R.id.crypto_status_text); cryptoModeSelector.setCryptoStatusListener(this); Bundle arguments = savedInstanceState != null ? savedInstanceState : getArguments(); currentMode = CryptoMode.valueOf(arguments.getString(ARG_CURRENT_MODE)); updateView(false); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(view); builder.setPositiveButton(R.string.crypto_settings_ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); return builder.create(); }
Source:
public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, "Please click BACK again to exit", Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 3000); }

Target:
public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, getString(R.string.double_press_to_exit), Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 3000); }
Source:
public void addFollowingAccounts(List<DeterministicKey> followingAccountKeys) { if (isMarried()) { throw new IllegalStateException("KeyChainGroup is married already"); } DeterministicKey accountKey = getActiveKeyChain().getWatchingKey(); followingKeychains = HashMultimap.create(); for (DeterministicKey key : followingAccountKeys) { checkArgument(key.getPath().size() == 1, "Following keys have to be account keys"); DeterministicKeyChain chain = DeterministicKeyChain.watchAndFollow(key); if (lookaheadSize > 0) { chain.setLookaheadSize(lookaheadSize); } followingKeychains.put(accountKey, chain); } }

Target:
public void addFollowingAccounts(List<DeterministicKey> followingAccountKeys) { checkState(!isMarried(), "KeyChainGroup is married already"); checkState(getActiveKeyChain().numLeafKeysIssued() == 0, "Active keychain already has keys in use"); DeterministicKey accountKey = getActiveKeyChain().getWatchingKey(); for (DeterministicKey key : followingAccountKeys) { checkArgument(key.getPath().size() == 1, "Following keys have to be account keys"); DeterministicKeyChain chain = DeterministicKeyChain.watchAndFollow(key); if (lookaheadSize > 0) { chain.setLookaheadSize(lookaheadSize); } followingKeychains.put(accountKey, chain); } }
Source:
public int outboundMessagesQueueSize() { if (mreg == null) return -1; return (int) mreg.longAdderMetric( OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_NAME, OUTBOUND_MESSAGES_QUEUE_SIZE_METRIC_DESC ).value(); }

Target:
public int outboundMessagesQueueSize() { if (outboundMessagesQueueSizeMetric == null) return -1; return (int) outboundMessagesQueueSizeMetric.value(); }
Source:
protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); lblSelect.setText("Select synoptic:"); List<String> columnNames = Arrays.asList("Name"); items = createTable(container, SWT.BORDER | SWT.V_SCROLL, columnNames); List<String> names = (List<String>) SynopticInfo.names(available); names.sort(String.CASE_INSENSITIVE_ORDER); setItems(names); }

Target:
protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); lblSelect.setText("Select synoptic:"); List<String> columnNames = Arrays.asList("Name"); items = createTable(container, SWT.BORDER | SWT.V_SCROLL, columnNames); List<String> names = SynopticInfo.names(available).stream() .sorted(String.CASE_INSENSITIVE_ORDER) .collect(Collectors.toList()); setItems(names); }
Source:
public Page getOutput() { if (state != State.HAS_OUTPUT) { return null; } List<Type> types = aggregates.stream().map(Aggregator::getType).collect(toImmutableList()); PageBuilder pageBuilder = new PageBuilder(1, types); pageBuilder.declarePosition(); for (int i = 0; i < aggregates.size(); i++) { Aggregator aggregator = aggregates.get(i); BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(i); aggregator.evaluate(blockBuilder); } state = State.FINISHED; Page page = pageBuilder.build(); if (partial) { BlockBuilder blockBuilder = TINYINT.createBlockBuilder(null, 1); TINYINT.writeLong(blockBuilder, 1); page = page.prependColumn(blockBuilder.build()); } return page; }

Target:
public Page getOutput() { if (partialOutput.isPresent()) { Page output = partialOutput.get(); partialOutput = Optional.empty(); return output; } if (state != State.FINISHING) { return null; } state = State.FINISHED; return processor.getFinalOutput(); }
Source:
public void testObjectsFitBucketThatHasContent() throws IOException, URISyntaxException { putObjectThenRunVerification(new FileSystemHelperImpl(), new ResultVerifier() { @Override public void verifyResult(ObjectStorageSpaceVerificationResult result, long totalRequiredSize) { assertEquals(ObjectStorageSpaceVerificationResult.VerificationStatus.OK, result.getVerificationStatus()); assertEquals(result.getRequiredSpace(), totalRequiredSize); assertTrue(result.getAvailableSpace() > 0); assertTrue(result.containsSufficientSpace()); assertNull(result.getIoException()); } }); }

Target:
public void testObjectsFitBucketThatHasContent() throws IOException, URISyntaxException { putObjectThenRunVerification(new FileSystemHelperImpl(), new ResultVerifier() { @Override public void verifyResult(final ObjectStorageSpaceVerificationResult result, final long totalRequiredSize) { assertEquals(ObjectStorageSpaceVerificationResult.VerificationStatus.OK, result.getVerificationStatus()); assertEquals(result.getRequiredSpace(), totalRequiredSize); assertTrue(result.getAvailableSpace() > 0); assertTrue(result.containsSufficientSpace()); assertNull(result.getIoException()); } }); }
Source:
protected void checkAccessControlForInstructorFeedbackSubmission( InstructorAttributes instructor, FeedbackSessionAttributes feedbackSession) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); if (StringHelper.isEmpty(moderatedPerson) && StringHelper.isEmpty(previewAsPerson)) { gateKeeper.verifySessionSubmissionPrivilegeForInstructor(feedbackSession, instructor); } else { gateKeeper.verifyLoggedInUserPrivileges(); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); } }

Target:
protected void checkAccessControlForInstructorFeedbackSubmission( InstructorAttributes instructor, FeedbackSessionAttributes feedbackSession) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); if (!StringHelper.isEmpty(moderatedPerson)) { gateKeeper.verifyLoggedInUserPrivileges(); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); } else if (!StringHelper.isEmpty(previewAsPerson)) { gateKeeper.verifyLoggedInUserPrivileges(); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } else { gateKeeper.verifySessionSubmissionPrivilegeForInstructor(feedbackSession, instructor); } }
Source:
public static Time TO_TIME(String source, String format) throws SQLException { if (source == null) return null; Date date = TO_DATE(source, format); return new Time(date.getTime()) ; }

Target:
public static Time TO_TIME(String source, String format) throws SQLException { if (source == null) return null; return new Time(stringWithFormatToDateTime(source, format).getMillis()) ; }