auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <T, SpecT extends AbstractBrooklynObjectSpec<? extends T, SpecT>> SpecT createCatalogSpec( CatalogItem<T, SpecT> item, Set<String> encounteredTypes) throws PlanNotRecognizedException { if (item.getJavaType() != null) { Class<?> type; try { type = CatalogUtils.newClassLoadingContext(mgmt, item).loadClass(item.getJavaType()); } catch (Exception e) { Exceptions.propagateIfFatal(e); throw new IllegalStateException("Unable to load old-style java catalog item type " + item.getJavaType() + " for item " + item, e); } AbstractBrooklynObjectSpec<?,?> spec; if (Entity.class.isAssignableFrom(type)) { @SuppressWarnings("unchecked") Class<Entity> entityType = (Class<Entity>)type; spec = EntitySpec.create(entityType); } else if (Policy.class.isAssignableFrom(type)) { @SuppressWarnings("unchecked") Class<Policy> policyType = (Class<Policy>)type; spec = PolicySpec.create(policyType); } else { throw new IllegalStateException("Catalog item " + item + " java type " + item.getJavaType() + " is not a Brooklyn supported object."); } spec.catalogItemId(item.getCatalogItemId()); @SuppressWarnings("unchecked") SpecT untypedSpc = (SpecT) spec; return untypedSpc; } else { throw new PlanNotRecognizedException(getClass().getName() + " parses only old-style catalog items containing javaType"); } }

Target:
public <T, SpecT extends AbstractBrooklynObjectSpec<? extends T, SpecT>> SpecT createCatalogSpec( CatalogItem<T, SpecT> item, Set<String> encounteredTypes) throws PlanNotRecognizedException { if (item.getJavaType() != null) { log.warn("Deprecated functionality (since 0.9.0). Using old-style xml catalog items with java type attribute for " + item); Class<?> type; try { type = CatalogUtils.newClassLoadingContext(mgmt, item).loadClass(item.getJavaType()); } catch (Exception e) { Exceptions.propagateIfFatal(e); throw new IllegalStateException("Unable to load old-style java catalog item type " + item.getJavaType() + " for item " + item, e); } AbstractBrooklynObjectSpec<?,?> spec; if (Entity.class.isAssignableFrom(type)) { @SuppressWarnings("unchecked") Class<Entity> entityType = (Class<Entity>)type; spec = EntitySpec.create(entityType); } else if (Policy.class.isAssignableFrom(type)) { @SuppressWarnings("unchecked") Class<Policy> policyType = (Class<Policy>)type; spec = PolicySpec.create(policyType); } else { throw new IllegalStateException("Catalog item " + item + " java type " + item.getJavaType() + " is not a Brooklyn supported object."); } spec.catalogItemId(item.getCatalogItemId()); @SuppressWarnings("unchecked") SpecT untypedSpc = (SpecT) spec; return untypedSpc; } else { throw new PlanNotRecognizedException(getClass().getName() + " parses only old-style catalog items containing javaType"); } }
Source:
public AbstractCard(String webUrl) throws CardBuilderException { webUrl(webUrl); MetaTagModel metaTagModel = MetaTagExtractor.getMetaTags(this.webUrl); setAppLinkIos(metaTagModel.getAppLinkIos()); setAppLinkIos(metaTagModel.getAppLinkAndroid()); setMetaTagModel(metaTagModel); }

Target:
public AbstractCard(String webUrl) throws CardBuilderException { webUrl(webUrl); MetaTagModel metaTagModel = MetaTagExtractor.getMetaTags(this.webUrl); setAppLinkIos(metaTagModel.getAppLinkIos()); setAppLinkAndroid(metaTagModel.getAppLinkAndroid()); setMetaTagModel(metaTagModel); }
Source:
public void getRegisterData(IRegisterDMContext regDmc , final DataRequestMonitor<IRegisterDMData> rm) { if (regDmc instanceof MIRegisterDMC) { final MIRegisterDMC miRegDmc = (MIRegisterDMC)regDmc; final IFrameDMContext frameDmc = DMContexts.getAncestorOfType(regDmc, IFrameDMContext.class); if(frameDmc == null){ rm.setData(new RegisterData(frameDmc, miRegDmc.getName(), BLANK_STRING, false)); rm.done(); return; } int[] regnos = {miRegDmc.getRegNo()}; fRegisterValueCache.execute( fCommandFactory.createMIDataListRegisterValues(frameDmc, MIFormat.HEXADECIMAL, regnos), new DataRequestMonitor<MIDataListRegisterValuesInfo>(getExecutor(), rm) { @Override protected void handleSuccess() { MIRegisterValue[] regValue = getData().getMIRegisterValues(); if (regValue.length == 0) { assert false : "Backend protocol error"; rm.done(); return; } assert regValue.length == 1; MIRegisterValue reg = regValue[0]; boolean isFloat = false; if ( reg.getValue().contains("float")) { isFloat = true; } rm.setData(new RegisterData(frameDmc, miRegDmc.getName(), BLANK_STRING, isFloat)); rm.done(); } }); } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Unknown DMC type", null)); rm.done(); } }

Target:
public void getRegisterData(IRegisterDMContext regDmc , final DataRequestMonitor<IRegisterDMData> rm) { if (regDmc instanceof MIRegisterDMC) { final MIRegisterDMC miRegDmc = (MIRegisterDMC)regDmc; final IFrameDMContext frameDmc = DMContexts.getAncestorOfType(regDmc, IFrameDMContext.class); if(frameDmc == null){ rm.setData(new RegisterData(null, miRegDmc.getName(), BLANK_STRING, false)); rm.done(); return; } int[] regnos = {miRegDmc.getRegNo()}; fRegisterValueCache.execute( fCommandFactory.createMIDataListRegisterValues(frameDmc, MIFormat.HEXADECIMAL, regnos), new DataRequestMonitor<MIDataListRegisterValuesInfo>(getExecutor(), rm) { @Override protected void handleSuccess() { MIRegisterValue[] regValue = getData().getMIRegisterValues(); if (regValue.length == 0) { assert false : "Backend protocol error"; rm.done(); return; } assert regValue.length == 1; MIRegisterValue reg = regValue[0]; boolean isFloat = false; if ( reg.getValue().contains("float")) { isFloat = true; } rm.setData(new RegisterData(frameDmc, miRegDmc.getName(), BLANK_STRING, isFloat)); rm.done(); } }); } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Unknown DMC type", null)); rm.done(); } }
Source:
public ChangeRequestSCMHeadCategory() { super("change-requests", Messages._ChangeRequestSCMHeadCategory_DisplayName()); }

Target:
private ChangeRequestSCMHeadCategory() { super("change-requests", Messages._ChangeRequestSCMHeadCategory_DisplayName()); }
Source:
KeyedMeter(String key, String name) { _key = key; _name = name; _isEagerlyRegistered = false; }

Target:
KeyedMeter(String key, String name) { this(key, name, false); }
Source:
public void testValidateBondsNewSlaveAddedToBond(){ List<Bond> parametersBondList = new ArrayList<Bond>(); Set<VdsNetworkInterface> existingNics = new HashSet<VdsNetworkInterface>(); Bond unmanagedBond = createBond("bond_unmanaged", "eth0", "eth1", "eth2"); existingNics.add(unmanagedBond); Bond bond = createBond("bond0", "eth0", "eth1", "eth2"); parametersBondList.add(bond); Bond existingBond = createBond("bond0", "eth0", "eth1"); existingNics.add(existingBond); BusinessEntityMap nicEntityMap = new BusinessEntityMap<VdsNetworkInterface>(existingNics); UnmanagedNetworkValidator validator = new UnmanagedNetworkValidator(); ValidationResult result = validator.validateBonds(unmanagedBond, parametersBondList, nicEntityMap); assertEquals(ValidationResult.VALID, result); }

Target:
public void testValidateBondsNewSlaveAddedToBond(){ VdsNetworkInterface unmanagedBond = createBond("bond_unmanaged", "eth0", "eth1", "eth2"); VdsNetworkInterface existingBond = createBond("bond0", "eth0", "eth1"); Set<VdsNetworkInterface> existingNics = new HashSet<>(Arrays.asList(unmanagedBond, existingBond)); Bond existingBondWithUnmanagedNetwork = createBond("bond0", "eth0", "eth1", "eth2"); List<Bond> bondsFromSetupNetworksParametersList = Arrays.asList(existingBondWithUnmanagedNetwork); BusinessEntityMap<VdsNetworkInterface> nicEntityMap = new BusinessEntityMap<>(existingNics); ValidationResult result = validator.validateBonds(unmanagedBond, bondsFromSetupNetworksParametersList, nicEntityMap); assertEquals(ValidationResult.VALID, result); }
Source:
private void handleReblogStateChanges() { mViewModel.getReblogState().observe(this, event -> { event.applyIfNotHandled(state -> { if (state instanceof NoSite) { ReaderActivityLauncher.showNoSiteToReblog(getActivity()); } else if (state instanceof SitePicker) { SitePicker spState = (SitePicker) state; ActivityLauncher.showSitePickerForResult( this, spState.getSite(), SitePickerMode.REBLOG_SELECT_MODE ); } else if (state instanceof PostEditor) { PostEditor peState = (PostEditor) state; ActivityLauncher.openEditorForReblog( getActivity(), peState.getSite(), peState.getPost(), PagePostCreationSourcesDetail.POST_FROM_REBLOG ); } else { ToastUtils.showToast(getActivity(), R.string.reader_reblog_error); } return null; }); }); }

Target:
private void handleReblogStateChanges() { mViewModel.getReblogState().observe(this, event -> { event.applyIfNotHandled(state -> { if (state instanceof NoSite) { ReaderActivityLauncher.showNoSiteToReblog(getActivity()); } else if (state instanceof SitePicker) { SitePicker spState = (SitePicker) state; ActivityLauncher.showSitePickerForResult( this, spState.getSite(), SitePickerMode.REBLOG_SELECT_MODE ); } else if (state instanceof PostEditor) { PostEditor postEditorStateData = (PostEditor) state; ActivityLauncher.openEditorForReblog( getActivity(), postEditorStateData.getSite(), postEditorStateData.getPost(), PagePostCreationSourcesDetail.POST_FROM_REBLOG ); } else { ToastUtils.showToast(getActivity(), R.string.reader_reblog_error); } return null; }); }); }
Source:
public V setValue(V arg0) { throw new IllegalStateException("Pairs are immutable."); }

Target:
public V setValue(V arg0) { throw new UnsupportedOperationException("Pairs are immutable."); }
Source:
public T get() throws InterruptedException, ExecutionException { try { T v = future.get(); onceToCircuitbreaker.applyOnce(cb -> nanosecondTimer.elapsed( time -> cb.onSuccess(time, TimeUnit.NANOSECONDS))); return v; } catch (CancellationException | InterruptedException e) { onceToCircuitbreaker.applyOnce(cb -> cb.releasePermission()); throw e; } catch (Exception e) { onceToCircuitbreaker.applyOnce(cb -> nanosecondTimer.elapsed( time -> cb.onError(time, TimeUnit.NANOSECONDS, e))); throw e; } finally { future.cancel(true); } }

Target:
public T get() throws InterruptedException, ExecutionException { try { T v = future.get(); onceToCircuitbreaker.applyOnce(cb -> cb.onSuccess(System.nanoTime() - start, TimeUnit.NANOSECONDS)); return v; } catch (CancellationException | InterruptedException e) { onceToCircuitbreaker.applyOnce(cb -> cb.releasePermission()); throw e; } catch (Exception e) { onceToCircuitbreaker.applyOnce(cb -> cb.onError(System.nanoTime() - start, TimeUnit.NANOSECONDS, e)); throw e; } }
Source:
public void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.phase != TickEvent.Phase.END || event.side != Side.SERVER) { return; } EntityPlayer player = event.player; World world = player.world; BlockPos pos = player.getPosition(); IWorldClimateHolder worldClimateHolder = ClimateManager.climateRoot.getWorldClimate(world); IClimateState climateState = worldClimateHolder.getState(pos); if (world.getTotalWorldTime() % 100 == 0 && !climateState.equals(previousState)) { ClimateHandlerServer.previousState = climateState; NetworkUtil.sendToPlayer(new PacketClimatePlayer(climateState), player); } }

Target:
public void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.phase != TickEvent.Phase.END || event.side != Side.SERVER) { return; } EntityPlayer player = event.player; World world = player.world; BlockPos pos = player.getPosition(); IWorldClimateHolder worldClimateHolder = ClimateManager.climateRoot.getWorldClimate(world); IClimateState climateState = worldClimateHolder.getState(pos); tickHelper.onTick(); if (tickHelper.updateOnInterval(100) && !climateState.equals(previousState)) { ClimateHandlerServer.previousState = climateState; NetworkUtil.sendToPlayer(new PacketClimatePlayer(climateState), player); } }
Source:
public void setActiveHandler(WorkbenchDocksHandler handler) { if (!isAuthoringActive()) { return; } if (activeHandler != null) { if (activeHandler.equals(handler) && !activeHandler.shouldRefreshDocks()) { return; } } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, currentPerspectiveIdentifier); uberfireDocks.hide(UberfireDockPosition.WEST, currentPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<WorkbenchDockEntry> docks = activeHandler.provideDocks(currentPerspectiveIdentifier); activeDocks = new UberfireDock[docks.size()]; int activeDocksIndex = 0; for(WorkbenchDockEntry entry: docks) { UberfireDock dock = entry.getDock(); uberfireDocks.add(dock); activeDocks[activeDocksIndex++] = dock; } uberfireDocks.show(UberfireDockPosition.EAST, currentPerspectiveIdentifier); uberfireDocks.show(UberfireDockPosition.WEST, currentPerspectiveIdentifier); for(WorkbenchDockEntry entry: docks) { UberfireDock dock = entry.getDock(); if (entry.isOpenByDefault()) { uberfireDocks.open(dock); } } } }

Target:
public void setActiveHandler(WorkbenchDocksHandler handler) { if (!isAuthoringActive()) { return; } if (activeHandler != null) { if (activeHandler.equals(handler) && !activeHandler.shouldRefreshDocks()) { return; } } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, currentPerspectiveIdentifier); uberfireDocks.hide(UberfireDockPosition.WEST, currentPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<WorkbenchDockEntry> docks = activeHandler.provideDocks(currentPerspectiveIdentifier); activeDocks = docks.stream() .map(entry -> entry.getDock()) .toArray(size -> new UberfireDock[size]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, currentPerspectiveIdentifier); uberfireDocks.show(UberfireDockPosition.WEST, currentPerspectiveIdentifier); docks.stream().forEach(entry -> { if (entry.getOpenOnInitialization()) { uberfireDocks.open(entry.getDock()); }}); } }
Source:
protected void run() throws Exception { AddCommand addCmd = new Git(db).add(); addCmd.setUpdate(update); for (String p : filepatterns) { addCmd.addFilepattern(p); } addCmd.call(); }

Target:
protected void run() throws Exception { AddCommand addCmd = new Git(db).add(); addCmd.setUpdate(update); for (String p : filepatterns) addCmd.addFilepattern(p); addCmd.call(); }
Source:
default void check() { if (isNewService() && dataDirectory().isDirectory()) { throw new IllegalArgumentException( "This timelock server has been configured as a new stack (the 'is-new-service' property is set to " + "true), but the Paxos data directory already exists. Almost surely this is because it " + "has already been turned on at least once, and thus the 'is-new-service' property should " + "be set to false for safety reasons."); } if (!isNewService() && !dataDirectory().isDirectory()) { throw new IllegalArgumentException( "If this is a new timelock service, please configure paxos.is-new-service to true for the first " + "startup only of each node. \n\nOtherwise, the timelock data directory appears to no " + "longer exist. If you are trying to move the nodes on your timelock cluster or add new " + "nodes, you have likely already made a mistake by this point. This is a non-trivial " + "operation, please be careful and do not be afraid to seek out help."); } Preconditions.checkArgument(dataDirectory().mkdirs() || dataDirectory().isDirectory(), "Could not create paxos data directory %s", dataDirectory()); }

Target:
default void check() { if (isNewService() && dataDirectory().isDirectory()) { throw new IllegalArgumentException( "This timelock server has been configured as a new stack (the 'is-new-service' property is set to " + "true), but the Paxos data directory already exists. Almost surely this is because it " + "has already been turned on at least once, and thus the 'is-new-service' property should " + "be set to false for safety reasons."); } if (!isNewService() && !dataDirectory().isDirectory()) { throw new IllegalArgumentException( "If this is a new timelock service, please configure paxos.is-new-service to true for the first " + "startup only of each node. \n\nOtherwise, the timelock data directory appears to no " + "longer exist. If you are trying to move the nodes on your timelock cluster or add new " + "nodes, you have likely already made a mistake by this point. This is a non-trivial " + "operation, please be careful and make sure that you have appropriate approvals."); } Preconditions.checkArgument(dataDirectory().mkdirs() || dataDirectory().isDirectory(), "Could not create paxos data directory %s", dataDirectory()); }
Source:
public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); if (null != resourceResolver) { DynamicDeckConfigurationService configurationService = getHelper().getService(DynamicDeckConfigurationService.class); if (null == configurationService) { LOGGER.debug("Configuration service is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Map<String, String> collectionMap = DynamicDeckUtils.getCollectionsListForLoggedInUser(configurationService.getCollectionQuery(), resourceResolver); options.put(StringUtils.EMPTY, "Select the Collection"); collectionMap.forEach((key, value) -> options.put(value, key)); } else { LOGGER.error("Exception occurred while initiating the deck generation"); } return options; }

Target:
public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); if (null != getHelper() && null != getHelper().getRequest() && null != getHelper().getRequest().getResourceResolver()) { ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); DynamicDeckConfigurationService configurationService = getHelper().getService(DynamicDeckConfigurationService.class); if (null == configurationService) { LOGGER.error("Configuration service is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Map<String, String> collectionMap = DynamicDeckUtils.getCollectionsListForLoggedInUser(configurationService.getCollectionQuery(), resourceResolver); options.put(StringUtils.EMPTY, "Select the Collection"); collectionMap.forEach((key, value) -> options.put(value, key)); } else { LOGGER.error("Resource resolver is null while getting the collection list"); } return options; }
Source:
private void processEmails(List<EmailMessage> partialEmailsForThreading, Iterator<EmailMessage> fullMessageIterator, AbstractFile abstractFile) { try { EmailMessageThreader.threadMessages(partialEmailsForThreading); } catch (Exception ex) { logger.log(Level.WARNING, String.format("Exception thrown parsing emails from %s", abstractFile.getName()), ex); } List<AbstractFile> derivedFiles = new ArrayList<>(); int msgCnt = 0; while (fullMessageIterator.hasNext()) { EmailMessage current = fullMessageIterator.next(); if (current == null) { continue; } if (partialEmailsForThreading.size() > msgCnt) { EmailMessage threaded = partialEmailsForThreading.get(msgCnt++); if ((threaded.getMessageID() != null) && (threaded.getMessageID().equals(current.getMessageID()) && threaded.getSubject().equals(current.getSubject()))) { current.setMessageThreadID(threaded.getMessageThreadID()); } } BlackboardArtifact msgArtifact = addEmailArtifact(current, abstractFile); if ((msgArtifact != null) && (current.hasAttachment())) { derivedFiles.addAll(handleAttachments(current.getAttachments(), abstractFile, msgArtifact)); } } if (derivedFiles.isEmpty() == false) { for (AbstractFile derived : derivedFiles) { services.fireModuleContentEvent(new ModuleContentEvent(derived)); } } context.addFilesToJob(derivedFiles); }

Target:
private void processEmails(List<EmailMessage> partialEmailsForThreading, Iterator<EmailMessage> fullMessageIterator, AbstractFile abstractFile) { try{ EmailMessageThreader.threadMessages(partialEmailsForThreading); } catch(Exception ex) { logger.log(Level.WARNING, String.format("Exception thrown parsing emails from %s", abstractFile.getName()), ex); } List<AbstractFile> derivedFiles = new ArrayList<>(); int msgCnt = 0; while(fullMessageIterator.hasNext()) { EmailMessage current = fullMessageIterator.next(); if(current == null) { continue; } if(partialEmailsForThreading.size() > msgCnt) { EmailMessage threaded = partialEmailsForThreading.get(msgCnt++); if(threaded.getMessageID().equals(current.getMessageID()) && threaded.getSubject().equals(current.getSubject())) { current.setMessageThreadID(threaded.getMessageThreadID()); } } BlackboardArtifact msgArtifact = addEmailArtifact(current, abstractFile); if ((msgArtifact != null) && (current.hasAttachment())) { derivedFiles.addAll(handleAttachments(current.getAttachments(), abstractFile, msgArtifact )); } } if (derivedFiles.isEmpty() == false) { for (AbstractFile derived : derivedFiles) { services.fireModuleContentEvent(new ModuleContentEvent(derived)); } } context.addFilesToJob(derivedFiles); }
Source:
private void doPartitionDetectionActivities(Set<Integer> failedHostIds) { Preconditions.checkState(!m_partitionDetected, "Partition detection triggered twice."); boolean isPartitionDetectionEnabled = false; try { isPartitionDetectionEnabled = VoltDB.instance().getCatalogContext().cluster.getNetworkpartition(); } catch (Exception e) { m_tmLog.fatal("Couldn't load partititon detection configuration during a partition event."); } Set<Integer> previousHosts = m_foreignHosts.keySet(); Set<Integer> currentHosts = new HashSet<>(previousHosts); currentHosts.removeAll(failedHostIds); boolean partitionDetected = makePPDDecision(previousHosts, currentHosts); if (partitionDetected) { if (isPartitionDetectionEnabled) { m_tmLog.fatal("PARTITION DETECTION: This process will kill itself to ensure against split-brains."); m_tmLog.warn("If command logging or periodic snapshots are enabled, the will be in the " + "voltdb root folder for this node and may be used for recovery if needed."); m_partitionDetected = true; VoltDB.crashGlobalVoltDB("This process will kill itself to ensure against split-brains. " + "There may be additional info in the full logs.", false, null); } else { m_tmLog.error("PARTITION DETECTION: This process will continue running only because " + "Partition Detection has been disabled for this cluster. It is possible that " + "the previous cluster has split into multiple viable clusters with diverging " + "data. There may be additional info in the full logs."); } } }

Target:
private void doPartitionDetectionActivities(Set<Integer> failedHostIds) { Preconditions.checkState(!m_partitionDetected, "Partition detection triggered twice."); Set<Integer> previousHosts = getLiveHostIds(); Set<Integer> currentHosts = new HashSet<>(previousHosts); currentHosts.removeAll(failedHostIds); Preconditions.checkState(previousHosts.contains(m_localHostId)); Preconditions.checkState(currentHosts.contains(m_localHostId)); boolean partitionDetected = makePPDDecision(previousHosts, currentHosts); if (partitionDetected) { if (m_partitionDetectionEnabled.get()) { m_tmLog.fatal("PARTITION DETECTION: This process will kill itself to ensure against split-brains."); m_tmLog.warn("If command logging or periodic snapshots are enabled, the will be in the " + "voltdb root folder for this node and may be used for recovery if needed."); m_partitionDetected = true; VoltDB.crashGlobalVoltDB("This process will kill itself to ensure against split-brains. " + "There may be additional info in the full logs.", false, null); } else { m_tmLog.error("PARTITION DETECTION: This process will continue running only because " + "Partition Detection has been disabled for this cluster. It is possible that " + "the previous cluster has split into multiple viable clusters with diverging " + "data. There may be additional info in the full logs."); } } }
Source:
public IterableStream<ConfigurationSetting> getElements() { return items == null ? IterableStream.empty() : new IterableStream<>(items); }

Target:
public IterableStream<ConfigurationSetting> getElements() { return IterableStream.of(items); }
Source:
public SubTabVolumeGeneralView(DetailModelProvider<VolumeListModel, VolumeGeneralModel> modelProvider, ApplicationConstants constants) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(formPanel); driver.initialize(this); formBuilder = new FormBuilder(formPanel, 1, 7); formBuilder.addFormItem(new FormItem(constants.NameVolume(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.volumeIdVolume(), volumeId, 1, 0)); formBuilder.addFormItem(new FormItem(constants.volumeTypeVolume(), volumeType, 2, 0)); replicaFormItem = new FormItem(constants.replicaCountVolume(), replicaCount, 3, 0); formBuilder.addFormItem(replicaFormItem); stripeFormItem = new FormItem(constants.stripeCountVolume(), stripeCount, 4, 0); formBuilder.addFormItem(stripeFormItem); formBuilder.addFormItem(new FormItem(constants.numberOfBricksVolume(), numOfBricks, 5, 0)); formBuilder.addFormItem(new FormItem(constants.transportTypesVolume(), transportTypes, 6, 0)); getDetailModel().getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { VolumeGeneralModel model = (VolumeGeneralModel) sender; if ("VolumeType".equals(((PropertyChangedEventArgs) args).propertyName)) { translateVolumeType((GlusterVolumeEntity) model.getEntity()); } } private void translateVolumeType(GlusterVolumeEntity volumeEntity) { Translator translator = EnumTranslator.getInstance(); if (translator.containsKey(volumeEntity.getVolumeType())) { getDetailModel().setVolumeTypeSilently(translator.get(volumeEntity.getVolumeType())); } } }); }

Target:
public SubTabVolumeGeneralView(DetailModelProvider<VolumeListModel, VolumeGeneralModel> modelProvider, ApplicationConstants constants) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(formPanel); driver.initialize(this); formBuilder = new FormBuilder(formPanel, 1, 7); formBuilder.addFormItem(new FormItem(constants.NameVolume(), name, 0, 0)); formBuilder.addFormItem(new FormItem(constants.volumeIdVolume(), volumeId, 1, 0)); formBuilder.addFormItem(new FormItem(constants.volumeTypeVolume(), volumeType, 2, 0)); replicaFormItem = new FormItem(constants.replicaCountVolume(), replicaCount, 3, 0); formBuilder.addFormItem(replicaFormItem); stripeFormItem = new FormItem(constants.stripeCountVolume(), stripeCount, 4, 0); formBuilder.addFormItem(stripeFormItem); formBuilder.addFormItem(new FormItem(constants.numberOfBricksVolume(), numOfBricks, 5, 0)); formBuilder.addFormItem(new FormItem(constants.transportTypesVolume(), transportTypes, 6, 0)); getDetailModel().getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { VolumeGeneralModel model = (VolumeGeneralModel) sender; if ("VolumeType".equals(((PropertyChangedEventArgs) args).propertyName)) { translateVolumeType((GlusterVolumeEntity) model.getEntity()); } } }); }
Source:
public abstract AbstractGCPTokenIdentifier createTokenIdentifier(Text renewer) throws IOException; public abstract AbstractGCPTokenIdentifier createTokenIdentifier() throws IOException; public abstract AbstractGCPTokenIdentifier createEmptyIdentifier(); protected <T extends AbstractGCPTokenIdentifier> T convertTokenIdentifier( final AbstractGCPTokenIdentifier identifier, final Class<T> expectedClass) throws DelegationTokenIOException { if (!identifier.getClass().equals(expectedClass)) { throw DelegationTokenIOException.wrongTokenType(expectedClass, identifier); } return (T) identifier; }

Target:
public abstract DelegationTokenIdentifier createTokenIdentifier(Text renewer) throws IOException; public abstract DelegationTokenIdentifier createTokenIdentifier() throws IOException; public abstract DelegationTokenIdentifier createEmptyIdentifier(); protected <T extends DelegationTokenIdentifier> T convertTokenIdentifier( DelegationTokenIdentifier identifier, Class<T> expectedClass) throws DelegationTokenIOException { if (!identifier.getClass().equals(expectedClass)) { throw DelegationTokenIOException.wrongTokenType(expectedClass, identifier); } return (T) identifier; }
Source:
public void changePassword(String oldPassword, String newPassword) { }

Target:
public void changePassword(String oldPassword, String newPassword) { throw new UnsupportedOperationException("Not implemented, use updateUser()"); }
Source:
public PickerMilestone(TurboMilestone milestone) { super(milestone.getRepoId(), milestone.getId(), milestone.getTitle()); setDueDate(milestone.getDueDate()); setDescription(milestone.getDescription() == null ? "" : milestone.getDescription()); setOpen(milestone.isOpen()); setOpenIssues(milestone.getOpenIssues()); setClosedIssues(milestone.getClosedIssues()); }

Target:
public PickerMilestone(TurboMilestone milestone) { super(milestone.getRepoId(), milestone.getId(), milestone.getTitle()); setDueDate(milestone.getDueDate()); setDescription(milestone.getDescription()); setOpen(milestone.isOpen()); setOpenIssues(milestone.getOpenIssues()); setClosedIssues(milestone.getClosedIssues()); }
Source:
public TaskNounUiTextProvider() { Message<AbstractItem> message; try { Field taskNoun = AbstractItem.class.getDeclaredField("TASK_NOUN"); message = (Message<AbstractItem>) taskNoun.get(null); } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { LOGGER.log(Level.FINE, "This version of Jenkins does not have AbstractItem.TASK_NOUN", e); message = null; } this.taskNoun = message; }

Target:
public TaskNounUiTextProvider() { Message<AbstractItem> message; try { Field taskNoun = AbstractItem.class.getDeclaredField("TASK_NOUN"); message = (Message<AbstractItem>) taskNoun.get(null); } catch (NoSuchFieldException e) { LOGGER.log(Level.FINE, "This version of Jenkins does not have AbstractItem.TASK_NOUN", e); message = null; } catch (IllegalAccessException | ClassCastException e) { LOGGER.log(Level.WARNING, "Could not access AbstractItem.TASK_NOUN by reflection", e); message = null; } this.taskNoun = message; }
Source:
public TypeInformation getAccumulatorType() { return resultType; }

Target:
public TypeInformation getAccumulatorType() { return accumulatorType; }
Source:
public static II getPatientId(PRPAIN201305UV02 request) { LOG.info("getPatientId()"); II livingSubjectId = null; if (request != null && request.getControlActProcess() != null && request.getControlActProcess().getQueryByParameter() != null && request.getControlActProcess().getQueryByParameter().getValue() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getLivingSubjectId() != null) { List<PRPAMT201306UV02LivingSubjectId> ids = request.getControlActProcess().getQueryByParameter().getValue() .getParameterList().getLivingSubjectId(); if (ids != null) { if (ids.size() == 1) { livingSubjectId = getLivingSubjectId(ids.get(0)); } else if (ids.size() > 1) { livingSubjectId = getLivingSubjectIdFromAuthorOrPerformerValue(request, ids); } } } else { LOG.error("PatientId doesn't exist in the received PRPAIN201305UV02 message"); } return livingSubjectId; }

Target:
public static II getPatientId(PRPAIN201305UV02 request) { II livingSubjectId = null; if (request != null && request.getControlActProcess() != null && request.getControlActProcess().getQueryByParameter() != null && request.getControlActProcess().getQueryByParameter().getValue() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getLivingSubjectId() != null) { List<PRPAMT201306UV02LivingSubjectId> ids = request.getControlActProcess().getQueryByParameter().getValue() .getParameterList().getLivingSubjectId(); if (ids != null && !ids.isEmpty()) { if (ids.size() == 1) { livingSubjectId = getLivingSubjectId(ids.get(0)); } else if (ids.size() > 1) { livingSubjectId = getLivingSubjectIdFromAuthorOrPerformerValue(request, ids); } } } else { LOG.error("PatientId doesn't exist in the received PRPAIN201305UV02 message"); } return livingSubjectId; }
Source:
private void previewDataImport() { DataImportOptions previewImportOptions = getOptions(); assembleDataImport(); if (fileOrUrlChooserTextBox_.getText() == "") { gridViewer_.setData(null); return; } previewImportOptions.setMaxRows(maxRows_); progressIndicator_.onProgress("Retrieving preview data"); server_.previewDataImport(previewImportOptions, maxCols_, maxFactors_, new ServerRequestCallback<DataImportPreviewResponse>() { @Override public void onResponseReceived(DataImportPreviewResponse response) { if (response.getErrorMessage() != null) { response.setColumnDefinitions(lastSuccessfulResponse_); setGridViewerData(response); progressIndicator_.onError(response.getErrorMessage()); return; } lastSuccessfulResponse_ = response; gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries. " + Integer.toString(response.getParsingErrors()) + " parsing errors."); assignColumnDefinitions(response, importOptions_.getColumnDefinitions()); setGridViewerData(response); gridViewer_.setColumnDefinitionsUIVisible(true, onColumnMenuShow(), new Operation() { @Override public void execute() { columnTypesMenu_.hide(); } }); progressIndicator_.onCompleted(); } @Override public void onError(ServerError error) { gridViewer_.setData(null); progressIndicator_.onError(error.getMessage()); } }); }

Target:
private void previewDataImport() { DataImportOptions previewImportOptions = getOptions(); assembleDataImport(); if (fileOrUrlChooserTextBox_.getText() == "") { gridViewer_.setData(null); return; } previewImportOptions.setMaxRows(maxRows_); progressIndicator_.onProgress("Retrieving preview data"); server_.previewDataImport(previewImportOptions, maxCols_, maxFactors_, new ServerRequestCallback<DataImportPreviewResponse>() { @Override public void onResponseReceived(DataImportPreviewResponse response) { if (response.getErrorMessage() != null) { response.setColumnDefinitions(lastSuccessfulResponse_); setGridViewerData(response); progressIndicator_.onError(response.getErrorMessage()); return; } lastSuccessfulResponse_ = response; gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries. " + ( response.getParsingErrors() > 0 ? Integer.toString(response.getParsingErrors()) + " parsing errors." : "") ); assignColumnDefinitions(response, importOptions_.getColumnDefinitions()); setGridViewerData(response); gridViewer_.setColumnDefinitionsUIVisible(true, onColumnMenuShow(), new Operation() { @Override public void execute() { columnTypesMenu_.hide(); } }); progressIndicator_.onCompleted(); } @Override public void onError(ServerError error) { gridViewer_.setData(null); progressIndicator_.onError(error.getMessage()); } }); }
Source:
public void endElement(String uri, String localName, String qname) throws SAXException { String s = sb.toString(); if ("author".equals(qname)) { entry.setAuthor(s); } else if ("date".equals(qname)) { try { String dateString = s; if (s.length() > 24) { dateString = dateString.substring(0, 23) + dateString.charAt(dateString.length() - 1); } entry.setDate(repository.parse(dateString)); } catch (ParseException ex) { throw new SAXException("Failed to parse date: " + s, ex); } } else if ("path".equals(qname)) { if (s.startsWith(prefix) && !s.equals(prefix)) { File file = new File(home, s.substring(prefix.length())); String path = file.getAbsolutePath().substring(length); entry.addFile(path.intern()); if (isRenamed) { renamedFiles.add(file.getAbsolutePath().substring(home.length() + 1)); } } else { LOGGER.log(Level.FINER, "Skipping file outside repository: " + s); } } else if ("msg".equals(qname)) { entry.setMessage(s); } if ("logentry".equals(qname)) { entries.add(entry); } sb.setLength(0); }

Target:
public void endElement(String uri, String localName, String qname) throws SAXException { String s = sb.toString(); if ("author".equals(qname)) { entry.setAuthor(s); } else if ("date".equals(qname)) { try { String dateString = s; if (s.length() > SVN_MILLIS_DATE_LENGTH) { dateString = dateString.substring(0, SVN_MILLIS_DATE_LENGTH - 1) + dateString.charAt(dateString.length() - 1); } entry.setDate(repository.parse(dateString)); } catch (ParseException ex) { throw new SAXException("Failed to parse date: " + s, ex); } } else if ("path".equals(qname)) { if (s.startsWith(prefix) && !s.equals(prefix)) { File file = new File(home, s.substring(prefix.length())); String path = file.getAbsolutePath().substring(length); entry.addFile(path.intern()); if (isRenamed) { renamedFiles.add(file.getAbsolutePath().substring(home.length() + 1)); } } else { LOGGER.log(Level.FINER, "Skipping file outside repository: " + s); } } else if ("msg".equals(qname)) { entry.setMessage(s); } if ("logentry".equals(qname)) { entries.add(entry); } sb.setLength(0); }
Source:
private static Supplier<ByteBuffer> createCombineBufferSupplier( ByteBuffer combineBuffer, int numBuffers, int sliceSize ) { return new Supplier<ByteBuffer>() { private int i = 0; @Override public ByteBuffer get() { if (i < numBuffers) { return Groupers.getSlice(combineBuffer, sliceSize, i++); } else { throw new ISE("Requested number of buffer slices exceeds the planned one"); } } }; }

Target:
private static Supplier<ByteBuffer> createCombineBufferSupplier( ByteBuffer combineBuffer, int numBuffers, int sliceSize ) { return new Supplier<ByteBuffer>() { private int i = 0; @Override public ByteBuffer get() { if (i < numBuffers) { return Groupers.getSlice(combineBuffer, sliceSize, i++); } else { throw new ISE("Requested number[%d] of buffer slices exceeds the planned one[%d]", i++, numBuffers); } } }; }
Source:
public static Configuration setUpConfigForMiniCluster(Configuration conf, ReadOnlyProps overrideProps) throws Exception { assertNotNull(conf); setDefaultTestConfig(conf, overrideProps); conf.setInt(HConstants.REGION_SERVER_HANDLER_COUNT, 5); conf.setInt("hbase.regionserver.metahandler.count", 2); conf.setInt(HConstants.MASTER_HANDLER_COUNT, 2); conf.setInt("dfs.namenode.handler.count", 2); conf.setInt("dfs.namenode.service.handler.count", 2); conf.setInt("dfs.datanode.handler.count", 2); conf.setInt("ipc.server.read.threadpool.size", 2); conf.setInt("ipc.server.handler.threadpool.size", 2); conf.setInt("hbase.regionserver.hlog.syncer.count", 2); conf.setInt("hbase.hlog.asyncer.number", 2); conf.setInt("hbase.assignment.zkevent.workers", 5); conf.setInt("hbase.assignment.threads.max", 5); conf.setInt("hbase.catalogjanitor.interval", 5000); conf.setInt(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB, 10000); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); conf.setInt(NUM_CONCURRENT_INDEX_WRITER_THREADS_CONF_KEY, 1); conf.setInt(GLOBAL_INDEX_ROW_AGE_THRESHOLD_TO_DELETE_MS_ATTRIB, 0); if (conf.getLong(QueryServices.UNGROUPED_AGGREGATE_PAGE_SIZE_IN_ROWS, 0) == 0) { conf.setLong(QueryServices.UNGROUPED_AGGREGATE_PAGE_SIZE_IN_ROWS, 2); } return conf; }

Target:
public static Configuration setUpConfigForMiniCluster(Configuration conf, ReadOnlyProps overrideProps) throws Exception { assertNotNull(conf); setDefaultTestConfig(conf, overrideProps); conf.setInt(HConstants.REGION_SERVER_HANDLER_COUNT, 5); conf.setInt("hbase.regionserver.metahandler.count", 2); conf.setInt(HConstants.MASTER_HANDLER_COUNT, 2); conf.setInt("dfs.namenode.handler.count", 2); conf.setInt("dfs.namenode.service.handler.count", 2); conf.setInt("dfs.datanode.handler.count", 2); conf.setInt("ipc.server.read.threadpool.size", 2); conf.setInt("ipc.server.handler.threadpool.size", 2); conf.setInt("hbase.regionserver.hlog.syncer.count", 2); conf.setInt("hbase.hlog.asyncer.number", 2); conf.setInt("hbase.assignment.zkevent.workers", 5); conf.setInt("hbase.assignment.threads.max", 5); conf.setInt("hbase.catalogjanitor.interval", 5000); conf.setInt(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB, 10000); conf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2); conf.setInt(NUM_CONCURRENT_INDEX_WRITER_THREADS_CONF_KEY, 1); conf.setInt(GLOBAL_INDEX_ROW_AGE_THRESHOLD_TO_DELETE_MS_ATTRIB, 0); if (conf.getLong(QueryServices.UNGROUPED_AGGREGATE_PAGE_SIZE_IN_MS, 0) == 0) { conf.setLong(QueryServices.UNGROUPED_AGGREGATE_PAGE_SIZE_IN_MS, 0); } return conf; }
Source:
Builder() { this.startTime = 0; this.druidCluster = null; this.databaseRuleManager = null; this.segmentReplicantLookup = null; this.dataSources = Sets.newHashSet(); this.availableSegments = Sets.newTreeSet(DruidCoordinator.SEGMENT_COMPARATOR); this.loadManagementPeons = Maps.newHashMap(); this.replicationManager = null; this.emitter = null; this.stats = new CoordinatorStats(); this.coordinatorDynamicConfig = new CoordinatorDynamicConfig.Builder().build(); this.balancerReferenceTimestamp = DateTime.now(); this.strategyFactory = new CostBalancerStrategyFactory(1, 0.001F); }

Target:
Builder() { this.startTime = 0; this.druidCluster = null; this.databaseRuleManager = null; this.segmentReplicantLookup = null; this.dataSources = Sets.newHashSet(); this.availableSegments = Sets.newTreeSet(DruidCoordinator.SEGMENT_COMPARATOR); this.loadManagementPeons = Maps.newHashMap(); this.replicationManager = null; this.emitter = null; this.stats = new CoordinatorStats(); this.coordinatorDynamicConfig = new CoordinatorDynamicConfig.Builder().build(); this.balancerReferenceTimestamp = DateTime.now(); this.strategyFactory = new CostBalancerStrategyFactory(1, BalancerStrategy.DEFAULT_BALANCER_SLOPE); }
Source:
protected void setup(Binder binder) { T configuration = buildConfigObject(config); if (predicate.test(configuration)) { if (module instanceof ConfigurationAwareModule) { install((ConfigurationAwareModule) module); } else { binder.install(module); } } }

Target:
protected void setup(Binder binder) { T configuration = buildConfigObject(config); if (predicate.test(configuration)) { install(module); } }
Source:
protected void safeCreateTag(IProgressMonitor monitor, String tagName, String tagMessage) throws CoreException { RevCommit head = repository.findHead(); RevCommit commitForTag; try { commitForTag = repository.findCommitForTag(versionName); if (commitForTag == null) { createTag(monitor, head, tagName, tagMessage); } else if (!head.equals(commitForTag)) { throw new CoreException(error(format( CoreText.AbstractVersionFinishOperation_tagNameExists, versionName))); } } catch (MissingObjectException e) { throw new CoreException(error(e)); } catch (IncorrectObjectTypeException e) { throw new CoreException(error(e)); } catch (IOException e) { throw new CoreException(error(e)); } }

Target:
protected void safeCreateTag(IProgressMonitor monitor, String tagName, String tagMessage) throws CoreException { RevCommit head = repository.findHead(); RevCommit commitForTag; try { commitForTag = repository.findCommitForTag(versionName); if (commitForTag == null) { createTag(monitor, head, tagName, tagMessage); } else if (!head.equals(commitForTag)) { throw new CoreException(error(format( CoreText.AbstractVersionFinishOperation_tagNameExists, versionName))); } } catch (IOException e) { throw new CoreException(error(e)); } }
Source:
public String getAddEncountersPrivilege() { String ADD_ENCOUNTERS_PRIVILEGE = null; Privilege privilege = Context.getUserService().getPrivilege(ADD_ENCOUNTERS); if (privilege != null) { ADD_ENCOUNTERS_PRIVILEGE = ADD_ENCOUNTERS; } return ADD_ENCOUNTERS_PRIVILEGE; }

Target:
public String getAddEncountersPrivilege() { return checkPrivilege(ADD_ENCOUNTERS, null); }
Source:
public void onNewSourceColumn() { if (!userPrefs_.allowSourceColumns().getValue()) pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "Allow Source Columns preference is disabled."); else if (additionalSourceCount_ == MAX_COLUMN_COUNT) pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "You can't add more than " + MAX_COLUMN_COUNT + " columns."); else createSourceColumn(); }

Target:
public void onNewSourceColumn() { if (!userPrefs_.allowSourceColumns().getValue()) pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "Allow Source Columns preference is disabled."); else if (additionalSourceCount_ >= MAX_COLUMN_COUNT) pGlobalDisplay_.get().showMessage(GlobalDisplay.MSG_INFO, "Cannot Add Column", "You can't add more than " + MAX_COLUMN_COUNT + " columns."); else createSourceColumn(); }
Source:
public void shouldCreateFilter() throws Exception { CategoryFilterFactory categoryFilterFactory = new CategoryFilterFactoryStub(); Filter filter = categoryFilterFactory.createFilter(CategoryFilterFactoryStub.class.getName()); assertThat(filter, is((Filter) null)); }

Target:
public void shouldCreateFilter() throws Exception { FilterFactoryParams params = new FilterFactoryParams( CategoryFilterFactoryStub.class.getName()); Filter filter = categoryFilterFactory.createFilter(params); assertThat(filter, instanceOf(DummyFilter.class)); }
Source:
private static int getReadPositionAtReferencePositionIgnoreSoftClips(final SAMRecord rec, final int pos) { final int readPosition; final Cigar oldCigar = rec.getCigar(); final int oldStart = rec.getAlignmentStart(); final Cigar newCigar = new Cigar(); List<CigarElement> cigarElements = new ArrayList<>(oldCigar.getCigarElements()); int posShift = 0; boolean foundNonClip = false; for (final CigarElement cigarElement : cigarElements) { final CigarOperator op = cigarElement.getOperator(); if (op == CigarOperator.SOFT_CLIP) { newCigar.add(new CigarElement(cigarElement.getLength(), CigarOperator.MATCH_OR_MISMATCH)); if (!foundNonClip) { posShift += cigarElement.getLength(); } } else { if (!op.isClipping()) { foundNonClip = true; } newCigar.add(new CigarElement(cigarElement.getLength(), op)); } } rec.setAlignmentStart(rec.getAlignmentStart() - posShift); rec.setCigar(newCigar); readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos, false); rec.setCigar(oldCigar); rec.setAlignmentStart(oldStart); return readPosition; }

Target:
private static int getReadPositionAtReferencePositionIgnoreSoftClips(final SAMRecord rec, final int pos) { final int readPosition; final Cigar oldCigar = rec.getCigar(); final int oldStart = rec.getAlignmentStart(); final Cigar newCigar = new Cigar(); final List<CigarElement> cigarElements = new ArrayList<>(oldCigar.getCigarElements()); int posShift = 0; boolean foundNonClip = false; for (final CigarElement cigarElement : cigarElements) { final CigarOperator op = cigarElement.getOperator(); if (op == CigarOperator.SOFT_CLIP) { newCigar.add(new CigarElement(cigarElement.getLength(), CigarOperator.MATCH_OR_MISMATCH)); if (!foundNonClip) { posShift += cigarElement.getLength(); } } else { if (!op.isClipping()) { foundNonClip = true; } newCigar.add(new CigarElement(cigarElement.getLength(), op)); } } rec.setCigar(newCigar); readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos, false); rec.setCigar(oldCigar); return readPosition + posShift; }