auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGeneralMeasurementEventsBroadcast() throws Exception { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>")); i.putExtra("foo", "bar"); ArrayList<String> arr = new ArrayList<String>(); arr.add("foo2"); arr.add("bar2"); i.putExtra("foobar", arr); Map<String, String> other = new HashMap<String, String>(); other.put("yetAnotherFoo", "yetAnotherBar"); final String[] receivedStrings = new String[5]; LocalBroadcastManager manager = LocalBroadcastManager.getInstance(getInstrumentation().getTargetContext()); manager.registerReceiver( new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String eventName = intent.getStringExtra("event_name"); Bundle eventArgs = intent.getBundleExtra("event_args"); receivedStrings[0] = eventName; receivedStrings[1] = eventArgs.getString("foo"); receivedStrings[2] = eventArgs.getString("foobar"); receivedStrings[3] = eventArgs.getString("yetAnotherFoo"); receivedStrings[4] = eventArgs.getString("intentData"); } }, new IntentFilter("com.parse.bolts.measurement_event") ); MeasurementEvent.sendEventBroadcast(getInstrumentation().getTargetContext(), "myEventName", i, other); CountDownLatch lock = new CountDownLatch(1); lock.await(2000, TimeUnit.MILLISECONDS); assertEquals("myEventName", receivedStrings[0]); assertEquals("bar", receivedStrings[1]); assertEquals((new JSONArray(arr)).toString(), receivedStrings[2]); assertEquals("yetAnotherBar", receivedStrings[3]); assertEquals("<LINK_0>", receivedStrings[4]); }

Target:
public void testGeneralMeasurementEventsBroadcast() throws Exception { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>")); i.putExtra("foo", "bar"); ArrayList<String> arr = new ArrayList<String>(); arr.add("foo2"); arr.add("bar2"); i.putExtra("foobar", arr); Map<String, String> other = new HashMap<String, String>(); other.put("yetAnotherFoo", "yetAnotherBar"); final CountDownLatch lock = new CountDownLatch(1); final String[] receivedStrings = new String[5]; LocalBroadcastManager manager = LocalBroadcastManager.getInstance(getInstrumentation().getTargetContext()); manager.registerReceiver( new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String eventName = intent.getStringExtra("event_name"); Bundle eventArgs = intent.getBundleExtra("event_args"); receivedStrings[0] = eventName; receivedStrings[1] = eventArgs.getString("foo"); receivedStrings[2] = eventArgs.getString("foobar"); receivedStrings[3] = eventArgs.getString("yetAnotherFoo"); receivedStrings[4] = eventArgs.getString("intentData"); lock.countDown(); } }, new IntentFilter("com.parse.bolts.measurement_event") ); MeasurementEvent.sendBroadcastEvent(getInstrumentation().getTargetContext(), "myEventName", i, other); lock.await(2000, TimeUnit.MILLISECONDS); assertEquals("myEventName", receivedStrings[0]); assertEquals("bar", receivedStrings[1]); assertEquals((new JSONArray(arr)).toString(), receivedStrings[2]); assertEquals("yetAnotherBar", receivedStrings[3]); assertEquals("<LINK_0>", receivedStrings[4]); }
Source:
public void delete_Map() { InteractiveMapPageObject iMap = base.openInteractiveMapById(wikiURL, Integer.parseInt(mapID)); DeleteAMapComponentObject deleteMapModal = iMap.deleteMap(); deleteMapModal.deleteMap(); }

Target:
public void delete_Map() { createdMap = base.openInteractiveMapById(wikiURL, Integer.parseInt(mapID)); DeleteAMapComponentObject deleteMapModal = createdMap.deleteMap(); InteractiveMapsPageObject specialMaps = deleteMapModal.deleteMap(); specialMaps.verifyEmptyState(); }
Source:
private void addAsset() { Asset a = new Asset(); EditAssetDialog ead = new EditAssetDialog(frame, a); ead.setTitle(resourceMap.getString("addAssetDialogTitle.text")); ead.setVisible(true); if(!ead.wasCancelled()) { ead.dispose(); campaign.getFinances().getAllAssets().add(a); MekHQ.triggerEvent(new AssetNewEvent(a)); refreshTable(); } }

Target:
private void addAsset() { Asset a = new Asset(); EditAssetDialog ead = new EditAssetDialog(frame, a); ead.setTitle(resourceMap.getString("addAssetDialogTitle.text")); ead.setVisible(true); if(!ead.wasCancelled()) { campaign.getFinances().getAllAssets().add(a); MekHQ.triggerEvent(new AssetNewEvent(a)); refreshTable(); } ead.dispose(); }
Source:
private static void writePcm32bitFloat(int val, ByteBuffer buffer) { float convVal = (float) (PCM_INT32_FLOAT * val); int bits = Float.floatToIntBits(convVal); if (bits == 0x7fc00000) bits = Float.floatToIntBits((float) 0.0); buffer.put((byte) (bits & 0xff)); buffer.put((byte) ((bits >> 8) & 0xff)); buffer.put((byte) ((bits >> 16) & 0xff)); buffer.put((byte) ((bits >> 24) & 0xff)); }

Target:
private static void writePcm32bitFloat(int val, ByteBuffer buffer) { float convVal = (float) (PCM_INT32_FLOAT * val); int bits = Float.floatToIntBits(convVal); if (bits == 0x7fc00000) bits = Float.floatToIntBits((float) 0.0); buffer.putInt(bits); }
Source:
public String getStringOfMaxLength(int maxlen) { LinkedHashMap<String, String> words = new LinkedHashMap<String,String>(); words.putAll(wordsByIdInOrder); int length = 0; for (String w: words.values()) { if (w!=null && w.length()>0) { length += w.length(); if (separator!=null) length += separator.length(); } } if (separator!=null && length>0) length -= separator.length(); List<ShorteningRule> rulesLeft = new ArrayList<ShorteningRule>(); rulesLeft.addAll(rules); while (length > maxlen && !rulesLeft.isEmpty()) { ShorteningRule r = rulesLeft.remove(0); length = r.apply(words, maxlen, length); } StringBuilder sb = new StringBuilder(); for (String w: words.values()) { if (w!=null && w.length()>0) { if (separator!=null && sb.length()>0) sb.append(separator); sb.append(w); } } String result = sb.toString(); if (result.length() > maxlen) result = result.substring(0, maxlen); return result; }

Target:
public String getStringOfMaxLength(int maxlen) { LinkedHashMap<String, String> words = new LinkedHashMap<String,String>(); words.putAll(wordsByIdInOrder); int length = 0; for (String w: words.values()) { if (!Strings.isBlank(w)) { length += w.length(); if (separator!=null) length += separator.length(); } } if (separator!=null && length>0) length -= separator.length(); List<ShorteningRule> rulesLeft = new ArrayList<ShorteningRule>(); rulesLeft.addAll(rules); while (length > maxlen && !rulesLeft.isEmpty()) { ShorteningRule r = rulesLeft.remove(0); length = r.apply(words, maxlen, length); } StringBuilder sb = new StringBuilder(); for (String w: words.values()) { if (!Strings.isBlank(w)) { if (separator!=null && sb.length()>0) sb.append(separator); sb.append(w); } } String result = sb.toString(); if (result.length() > maxlen) result = result.substring(0, maxlen); return result; }
Source:
private String performLogin(ICluster cluster, IAccount account) { if (null != provider) { LoginResponse response = provider.login(cluster, account); if (null != response) { if (null == account) { String id = OSIOUtils.decodeEmailFromToken(response.getAccessToken()); IAccount newAccount = cluster.createAccount(id); updateAccount(response, newAccount); cluster.addAccount(newAccount); return newAccount.getAccessToken(); } else { updateAccount(response, account); } return account.getAccessToken(); } else { throw new OpenshiftIOLoginException(cluster, account); } } else { throw new OpenshiftIOConfigurationException("No login provider found"); } }

Target:
private String performLogin(ICluster cluster, IAccount account) { if (null != provider) { LoginResponse response = provider.login(cluster, account); if (null != response) { if (null == account) { IAccount newAccount = createAccount(cluster, response); return newAccount.getAccessToken(); } else { updateAccount(response, account); } return account.getAccessToken(); } else { throw new OpenshiftIOLoginException(cluster, account); } } else { throw new OpenshiftIOConfigurationException("No login provider found"); } }
Source:
public Factory(List<Supplier<LookupSource>> partitions) { this.lookupSources = partitions.stream() .map(Supplier::get) .toArray(LookupSource[]::new); visitedPositions = Arrays.stream(this.lookupSources) .map(s -> toIntExact(s.getJoinPositionCount())) .map(boolean[]::new) .toArray(boolean[][]::new); }

Target:
public Factory(List<Supplier<LookupSource>> partitions) { this.lookupSources = partitions.stream() .map(Supplier::get) .toArray(LookupSource[]::new); visitedPositions = Arrays.stream(this.lookupSources) .map(LookupSource::getJoinPositionCount) .map(Math::toIntExact) .map(boolean[]::new) .toArray(boolean[][]::new); }
Source:
public List<AffinityGroup> mapAffinityGroups(Map<String, String> affinityGroupMap, List<AffinityGroup> affinityGroupsFromParam, Guid vmId) { if (affinityGroupsFromParam == null) { return Collections.emptyList(); } List<AffinityGroup> affinityGroups = new ArrayList<>(); affinityGroupsFromParam.forEach(affinityGroup -> { log.info("Mapping affinity group '{}/{} for vm '{}'.", affinityGroup.getId(), affinityGroup.getName(), vmId); AffinityGroup affGroup = getRelatedEntity(affinityGroupMap, affinityGroup.getName(), val -> affinityGroupDao.getByName((String) val)); if (affGroup != null) { Set<Guid> vmIds = new HashSet<>(affGroup.getVmIds()); vmIds.add(vmId); affGroup.setVmIds(new ArrayList<>(vmIds)); affinityGroups.add(affGroup); } }); return affinityGroups; }

Target:
public List<AffinityGroup> mapAffinityGroups(Map<String, String> affinityGroupMap, List<AffinityGroup> affinityGroupsFromParam, Guid vmId) { if (affinityGroupsFromParam == null) { return Collections.emptyList(); } List<AffinityGroup> affinityGroups = new ArrayList<>(); affinityGroupsFromParam.forEach(affinityGroup -> { AffinityGroup affGroup = getRelatedEntity(affinityGroupMap, affinityGroup.getName(), val -> affinityGroupDao.getByName((String) val)); if (affGroup != null) { log.info("Mapping affinity group '{}'/'{}', to '{}' for vm '{}'.", affinityGroup.getId(), affinityGroup.getName(), affGroup.getName(), vmId); Set<Guid> vmIds = new HashSet<>(affGroup.getVmIds()); vmIds.add(vmId); affGroup.setVmIds(new ArrayList<>(vmIds)); affinityGroups.add(affGroup); } }); return affinityGroups; }
Source:
public Boolean ternaryEquals( AnyValue other ) { if ( other == null || other == NO_VALUE ) { return null; } if ( other instanceof SequenceValue && this.isSequenceValue() ) { return ((SequenceValue) this).ternaryEquality( (SequenceValue) other ); } if ( other instanceof Value && ((Value) other).valueGroup() == valueGroup() ) { Value otherValue = (Value) other; if ( this.isNaN() || otherValue.isNaN() ) { return null; } return equals( otherValue ); } return false; }

Target:
public Boolean ternaryEquals( AnyValue other ) { if ( other == null || other == NO_VALUE ) { return null; } if ( other.isSequenceValue() && this.isSequenceValue() ) { return ((SequenceValue) this).ternaryEquality( (SequenceValue) other ); } if ( other instanceof Value && ((Value) other).valueGroup() == valueGroup() ) { Value otherValue = (Value) other; if ( this.isNaN() || otherValue.isNaN() ) { return null; } return equals( otherValue ); } return false; }
Source:
public void testQuotedColumnName() { MessageType schema = MessageTypeParser.parseMessageType( "message Document {\n" + " required group foo {\n" + " required int64 `bar?@`;\n" + " }\n" + "}\n"); GroupFactory gf = new SimpleGroupFactory(schema); Group g1 = gf.newGroup(); g1.addGroup("foo").append("bar?@", 2l); testSchema(schema, Arrays.asList(g1)); }

Target:
public void testQuotedColumnName() { MessageType schema = MessageTypeParser.parseMessageType( "message Document {\n" + " required group foo {\n" + " required int64 bar?@;\n" + " required int64 `foo bar`;\n" + " }\n" + "}\n"); GroupFactory gf = new SimpleGroupFactory(schema); Group g1 = gf.newGroup(); g1.addGroup("foo").append("bar?@", 2l).append("foo bar", 3l); testSchema(schema, Arrays.asList(g1)); }
Source:
List<ICommitMessageProvider> getCommitMessageProviders() { List<ICommitMessageProvider> foundProviders = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] configs = registry .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = "<unknown>"; String extensionId = "<unknown>"; try { extensionId = config.getDeclaringExtension() .getUniqueIdentifier(); contributorName = config.getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { foundProviders.add((ICommitMessageProvider) provider); } else { Activator.logError( MessageFormat.format( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, extensionId, contributorName), null); } } catch (CoreException | RuntimeException e) { Activator .logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, extensionId, contributorName), e); } } return foundProviders; }

Target:
List<ICommitMessageProvider> getCommitMessageProviders() { List<ICommitMessageProvider> providers = new ArrayList<>(); IConfigurationElement[] configs = Platform.getExtensionRegistry() .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = "<unknown>"; String extensionId = "<unknown>"; try { extensionId = config.getDeclaringExtension() .getUniqueIdentifier(); contributorName = config.getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { providers.add((ICommitMessageProvider) provider); } else { Activator.logError( MessageFormat.format( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, extensionId, contributorName), null); } } catch (CoreException | RuntimeException e) { Activator .logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, extensionId, contributorName), e); } } return providers; }
Source:
private boolean removeLeaseIfNeeded() { Guid leaseDomainIdToRemove = null; if (isRemoveLeaseNeeded(activeBeforeSnapshotLeaseDomainId, previewedSnapshotLeaseDomainId)) { leaseDomainIdToRemove = getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO ? previewedSnapshotLeaseDomainId : activeBeforeSnapshotLeaseDomainId; } else if (getParameters().getSnapshotAction() == SnapshotActionEnum.RESTORE_STATELESS && previewedSnapshotLeaseDomainId != null) { leaseDomainIdToRemove = previewedSnapshotLeaseDomainId; } return leaseDomainIdToRemove == null || removeVmLease(leaseDomainIdToRemove, getVmId()); }

Target:
private boolean removeLeaseIfNeeded() { if (isRemoveLeaseNeeded(activeBeforeSnapshotLeaseDomainId, previewedSnapshotLeaseDomainId)) { Guid leaseDomainIdToRemove = getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT ? activeBeforeSnapshotLeaseDomainId : previewedSnapshotLeaseDomainId; if (!removeVmLease(leaseDomainIdToRemove, getVmId())) { return false; } } return true; }
Source:
public String toString() { return String.format("vmId = %s, status = %s", getVmId(), getStatus()); }

Target:
public String toString() { return String.format("vmId = %s, status = %s, exit status = %s", getVmId(), getStatus(), getExitStatus()); }
Source:
public T decode(byte[] data) { ByteArrayInputStream bis = new ByteArrayInputStream(data); ObjectInput in = null; try { in = new ObjectInputStream(bis); return (T) in.readObject(); } catch (IOException | ClassNotFoundException e) { throw new IllegalArgumentException(e); } finally { try { if (in != null) { in.close(); } } catch (IOException ex) { } } }

Target:
public T decode(byte[] data) { ByteArrayInputStream bis = new ByteArrayInputStream(data); ObjectInput in = null; try { in = new ObjectInputStream(bis); return (T) in.readObject(); } catch (IOException | ClassNotFoundException e) { throw new IllegalArgumentException(e); } finally { try { if (in != null) { in.close(); } bis.close(); } catch (IOException ex) { } } }
Source:
public Set<String> getJWTExcludedClaims() { return jwtAdditionalClaims; }

Target:
public Set<String> getJWTExcludedClaims() { return jwtExcludedClaims; }
Source:
protected boolean isOrUnionReplacementEnabled() { String orUnionReplacement = System.getProperty("app-schema.orUnionReplace"); return (!"false".equalsIgnoreCase(orUnionReplacement)); }

Target:
protected boolean isOrUnionReplacementEnabled() { return AppSchemaDataAccessConfigurator.isOrUnionReplacementEnabled(); }
Source:
protected <Z extends ScesimDataWithIndex> List<Z> toScesimDataWithIndex(BiFunction<Integer, T, Z> producer) { List<Z> toReturn = new ArrayList<>(); List<T> data = getUnmodifiableData(); for (int index = 0; index < data.size(); index += 1) { toReturn.add(producer.apply(index + 1, data.get(index))); } return toReturn; }

Target:
protected <Z extends ScesimDataWithIndex<T>> List<Z> toScesimDataWithIndex(BiFunction<Integer, T, Z> producer) { List<Z> toReturn = new ArrayList<>(); List<T> data = getUnmodifiableData(); for (int index = 0; index < data.size(); index += 1) { toReturn.add(producer.apply(index + 1, data.get(index))); } return toReturn; }
Source:
public static <T> T buildInterface(Class<T> clazz, Context context, boolean perPageQueryParam) { RestAdapter restAdapter = CanvasRestAdapter.buildAdapter(context, perPageQueryParam); restAdapter.setLogLevel(RestAdapter.LogLevel.FULL); return restAdapter.create(clazz); }

Target:
public static <T> T buildInterface(Class<T> clazz, Context context, boolean perPageQueryParam) { RestAdapter restAdapter = CanvasRestAdapter.buildAdapter(context, perPageQueryParam); restAdapter.setLogLevel(LOG_LEVEL); return restAdapter.create(clazz); }
Source:
public InstanceProperties setWaitDuration(Duration waitDuration) { Objects.requireNonNull(waitDuration); if (waitDuration.toMillis() < 0) { throw new IllegalArgumentException( "waitDurationInOpenStateMillis must be a positive value"); } this.waitDuration = waitDuration; return this; }

Target:
public InstanceProperties setWaitDuration(Duration waitDuration) { Objects.requireNonNull(waitDuration); if (waitDuration.toMillis() < 0) { throw new IllegalArgumentException( "waitDuration must be a positive value"); } this.waitDuration = waitDuration; return this; }
Source:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator(new File(name))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); final WindowCursor curs = new WindowCursor(); try { p.reset(clp.getRepository(), clp.getRevWalk().parseTree(id), curs); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotRead, name) + ": " + e.getMessage()); } finally { curs.release(); } setter.addValue(p); return 1; }

Target:
public int parseArguments(final Parameters params) throws CmdLineException { final String name = params.getParameter(0); if (new File(name).isDirectory()) { setter.addValue(new FileTreeIterator(new File(name))); return 1; } if (new File(name).isFile()) { final DirCache dirc; try { dirc = DirCache.read(new File(name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); } setter.addValue(new DirCacheIterator(dirc)); return 1; } final ObjectId id; try { id = clp.getRepository().resolve(name); } catch (IOException e) { throw new CmdLineException(e.getMessage()); } if (id == null) throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); final CanonicalTreeParser p = new CanonicalTreeParser(); final WindowCursor curs = new WindowCursor(); try { p.reset(clp.getRepository(), clp.getRevWalk().parseTree(id), curs); } catch (MissingObjectException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IncorrectObjectTypeException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); } catch (IOException e) { throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); } finally { curs.release(); } setter.addValue(p); return 1; }
Source:
static <K, V> AssertsNearCache<K, V> create(Cache<byte[], ?> server, ConfigurationBuilder builder) { final BlockingQueue<MockEvent> events = new ArrayBlockingQueue<>(128); AtomicReference<NearCacheService<K, V>> nearCacheServiceAtomicReference = new AtomicReference<>(); RemoteCacheManager manager = new RemoteCacheManager(builder.build()) { @Override protected <KK, VV> NearCacheService<KK, VV> createNearCacheService(String cacheName, NearCacheConfiguration cfg) { MockNearCacheService nearCacheService = new MockNearCacheService<>(cfg, events, listenerNotifier); nearCacheServiceAtomicReference.set(nearCacheService); return nearCacheService; } }; return new AssertsNearCache<K, V>(manager, server, events, nearCacheServiceAtomicReference); }

Target:
static <K, V> AssertsNearCache<K, V> create(Cache<byte[], ?> server, ConfigurationBuilder builder) { final BlockingQueue<MockEvent> events = new ArrayBlockingQueue<>(128); AtomicReference<NearCacheService<K, V>> nearCacheServiceRef = new AtomicReference<>(); RemoteCacheManager manager = new RemoteCacheManager(builder.build()) { @Override protected <KK, VV> NearCacheService<KK, VV> createNearCacheService(String cacheName, NearCacheConfiguration cfg) { MockNearCacheService nearCacheService = new MockNearCacheService<>(cfg, events, listenerNotifier); nearCacheServiceRef.set(nearCacheService); return nearCacheService; } }; return new AssertsNearCache<K, V>(manager, server, events, nearCacheServiceRef); }
Source:
public boolean equals(Object o) { if (o instanceof SessionEditorInput && getInput() != null) { SessionEditorInput otherSessionEditorInput = (SessionEditorInput) o; if (otherSessionEditorInput.getSession() != null && otherSessionEditorInput.getSession().isOpen()) { EObject otherEObject = otherSessionEditorInput.getSession().getTransactionalEditingDomain().getResourceSet().getEObject(getURI(), false); getInput().equals(otherEObject); } } return super.equals(o); }

Target:
public boolean equals(Object o) { if (o instanceof SessionEditorInput && getInput() != null) { SessionEditorInput otherSessionEditorInput = (SessionEditorInput) o; Session otherSession = otherSessionEditorInput.getSession(); if (otherSession != null && otherSession.isOpen()) { EObject otherEObject = otherSession.getTransactionalEditingDomain().getResourceSet().getEObject(getURI(), false); return getInput().equals(otherEObject); } } return super.equals(o); }
Source:
private void createOptionsArea(Composite workArea) { Composite optionsGroup = new Composite(workArea, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginBottom = 2 * layout.marginHeight; layout.marginHeight = 0; optionsGroup.setLayout(layout); optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); nestedProjectsCheckbox = new Button(optionsGroup, SWT.CHECK); nestedProjectsCheckbox .setText(UIText.GitProjectsImportPage_SearchForNestedProjects); nestedProjectsCheckbox.setLayoutData(new GridData( GridData.FILL_HORIZONTAL)); nestedProjectsCheckbox.setSelection(nestedProjects); nestedProjectsCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { nestedProjects = nestedProjectsCheckbox.getSelection(); setProjectsList(lastPath); } }); hideConflictingProjectsCheckBox = new Button(optionsGroup, SWT.CHECK); hideConflictingProjectsCheckBox .setText(UIText.GitProjectsImportPage__hideConflictingProjects); hideConflictingProjectsCheckBox.setLayoutData(new GridData( GridData.FILL_HORIZONTAL)); hideConflictingProjectsCheckBox .addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { projectsList.removeFilter(conflictingProjectsFilter); if (hideConflictingProjectsCheckBox .getSelection()) { projectsList.addFilter(conflictingProjectsFilter); } } }); }

Target:
private void createOptionsArea(Composite workArea) { Composite optionsGroup = new Composite(workArea, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginBottom = 2 * layout.marginHeight; layout.marginHeight = 0; optionsGroup.setLayout(layout); optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); nestedProjectsCheckbox = new Button(optionsGroup, SWT.CHECK); nestedProjectsCheckbox .setText(UIText.GitProjectsImportPage_SearchForNestedProjects); nestedProjectsCheckbox.setLayoutData(new GridData( GridData.FILL_HORIZONTAL)); nestedProjectsCheckbox.setSelection(nestedProjects); nestedProjectsCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { nestedProjects = nestedProjectsCheckbox.getSelection(); setProjectsList(lastPath); } }); hideConflictingProjectsCheckBox = new Button(optionsGroup, SWT.CHECK); hideConflictingProjectsCheckBox .setText(UIText.GitProjectsImportPage_HideConflictingProjects); hideConflictingProjectsCheckBox.setLayoutData(new GridData( GridData.FILL_HORIZONTAL)); hideConflictingProjectsCheckBox .addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { projectsList.removeFilter(conflictingProjectsFilter); if (hideConflictingProjectsCheckBox .getSelection()) { projectsList.addFilter(conflictingProjectsFilter); } } }); }
Source:
public void run() throws Exception { ui.header("Review Labels"); boolean enabled = ui.yesno(false, "Install Verified label"); Config cfg = allProjectsConfig.load(); if (enabled) { cfg.setString(KEY_LABEL, LABEL_VERIFIED, KEY_FUNCTION, "MaxWithBlock"); cfg.setStringList(KEY_LABEL, LABEL_VERIFIED, KEY_VALUE, Arrays.asList(new String[] {"-1 Fails", " 0 No score", "+1 Verified"})); allProjectsConfig.save("Review Label Initialization"); } }

Target:
public void run() throws Exception { Config cfg = allProjectsConfig.load(); if (!cfg.getSubsections(KEY_LABEL).contains(LABEL_VERIFIED)) { ui.header("Review Labels"); boolean enabled = ui.yesno(false, "Install Verified label"); if (enabled) { cfg.setString(KEY_LABEL, LABEL_VERIFIED, KEY_FUNCTION, "MaxWithBlock"); cfg.setStringList(KEY_LABEL, LABEL_VERIFIED, KEY_VALUE, Arrays.asList(new String[] {"-1 Fails", " 0 No score", "+1 Verified"})); allProjectsConfig.save("Review Label Initialization"); } } }
Source:
public void step(int step, Closure closure) { if (step == 0) { return; } final boolean isAscending; if (step < 0) { step *= -1; isAscending = isReverse(); } else { isAscending = !isReverse(); } final long from = getFrom().longValue(), to = getTo().longValue(); if (isAscending) { for (long value = from; value <= to; value += step) { closure.call(value); } } else { for (long value = to; value >= from; value -= step) { closure.call(value); } } }

Target:
public void step(int step, Closure closure) { if (step == 0) { if (!getFrom().equals(getTo())) { throw new GroovyRuntimeException("Infinite loop detected due to step size of 0"); } return; } final boolean isAscending; if (step < 0) { step *= -1; isAscending = isReverse(); } else { isAscending = !isReverse(); } final long from = getFrom().longValue(), to = getTo().longValue(); if (isAscending) { for (long value = from; value <= to; value += step) { closure.call(value); } } else { for (long value = to; value >= from; value -= step) { closure.call(value); } } }
Source:
private Optional<HmmPdfInterface> getPdfFromObsModel(final SleepHmmBayesNetProtos.ObsModel obsModel) { final int measNumber = obsModel.getMeasType(0).getNumber(); if (obsModel.hasGaussian()) { return Optional.of((HmmPdfInterface)new GaussianPdf(obsModel.getGaussian().getMean(),obsModel.getGaussian().getStddev(),measNumber)); } if (obsModel.hasAlphabet()) { final int N = obsModel.getAlphabet().getProbabilitiesCount(); final List<Double> alphabetProbs = Lists.newArrayList(); for (int i = 0; i < N; i++) { alphabetProbs.add(obsModel.getAlphabet().getProbabilities(i)); } return Optional.of((HmmPdfInterface)new DiscreteAlphabetPdf(alphabetProbs,measNumber)); } if (obsModel.hasChisquare()) { return Optional.of((HmmPdfInterface)new ChiSquarePdf(obsModel.getChisquare().getMean(),measNumber)); } if (obsModel.hasGamma()) { return Optional.of((HmmPdfInterface)new GammaPdf(obsModel.getGamma().getMean(),obsModel.getGamma().getStddev(),measNumber)); } if (obsModel.hasPoisson()) { return Optional.of((HmmPdfInterface)new PoissonPdf(obsModel.getPoisson().getMean(),measNumber)); } return Optional.absent(); }

Target:
private Optional<HmmPdfInterface> getPdfFromObsModel(final SleepHmmBayesNetProtos.ObsModel obsModel) { if (obsModel.getMeasTypeCount() < 1) { return Optional.absent(); } final int measNumber = obsModel.getMeasType(0).getNumber(); if (obsModel.hasGaussian()) { return Optional.of((HmmPdfInterface)new GaussianPdf(obsModel.getGaussian().getMean(),obsModel.getGaussian().getStddev(),measNumber)); } if (obsModel.hasAlphabet()) { final int N = obsModel.getAlphabet().getProbabilitiesCount(); final List<Double> alphabetProbs = Lists.newArrayList(); for (int i = 0; i < N; i++) { alphabetProbs.add(obsModel.getAlphabet().getProbabilities(i)); } return Optional.of((HmmPdfInterface)new DiscreteAlphabetPdf(alphabetProbs,measNumber)); } if (obsModel.hasChisquare()) { return Optional.of((HmmPdfInterface)new ChiSquarePdf(obsModel.getChisquare().getMean(),measNumber)); } if (obsModel.hasGamma()) { return Optional.of((HmmPdfInterface)new GammaPdf(obsModel.getGamma().getMean(),obsModel.getGamma().getStddev(),measNumber)); } if (obsModel.hasPoisson()) { return Optional.of((HmmPdfInterface)new PoissonPdf(obsModel.getPoisson().getMean(),measNumber)); } return Optional.absent(); }
Source:
public void testExtractEncryptionContext() { Map<String, String> encryptionContext = KmsTextEncryptor.extractEncryptionContext(ENCRYPTION_TEXT); assertEquals(NUMBER_OF_ENTRIES, encryptionContext.size()); int found = 0; for (Entry<String, String> entry : encryptionContext.entrySet()) { if ("param".equals(entry.getKey())) { assertEquals("L’homme c’est rien", entry.getValue()); found++; } else if ("test".equals(entry.getKey())) { assertEquals("l’oeuvre c’est tout", entry.getValue()); found++; } else if ("valueless".equals(entry.getKey())) { assertEquals("An empty value must still be added!", "", entry.getValue()); found++; } } assertEquals("Test did not find right number of key and value pairs", NUMBER_OF_ENTRIES, found); }

Target:
public void testExtractEncryptionContext() { assertThat(KmsTextEncryptor.extractEncryptionContext(ENCRYPTION_TEXT)) .containsOnly( entry("param", "L’homme c’est rien"), entry("test", "l’oeuvre c’est tout"), entry("valueless", "")); }
Source:
private JarPackageData configureJar(final ICompilationUnit[] compilationUnits) { final JarPackageData jarPackakeData = newJarPackageData(); jarPackakeData.setJarLocation(Path.fromOSString(toFile.getAbsolutePath())); jarPackakeData.setElements(compilationUnits); jarPackakeData.setDeprecationAware(true); jarPackakeData.setExportJavaFiles(includeSources); jarPackakeData.setOverwrite(true); jarPackakeData.setExportErrors(false); return jarPackakeData; }

Target:
private JarPackageData configureJar(final ICompilationUnit[] compilationUnits) { final JarPackageData jarPackakeData = newJarPackageData(); jarPackakeData.setJarLocation(Path.fromOSString(toFile.getAbsolutePath())); jarPackakeData.setElements(compilationUnits); jarPackakeData.setDeprecationAware(true); jarPackakeData.setExportJavaFiles(includeSources); jarPackakeData.setOverwrite(true); return jarPackakeData; }
Source:
protected EObject addRow(EClass clazz, Setting mainSetting) { if (clazz.isAbstract() || clazz.isInterface()) { Activator .getInstance() .getLog() .log( new Status( IStatus.WARNING, "org.eclipse.emf.ecp.view.table.ui.swt", "The class " + clazz.getName() + " is abstract or an interface.")); return null; } final EObject modelElement = mainSetting.getEObject(); final EObject instance = clazz.getEPackage().getEFactoryInstance().create(clazz); final EditingDomain editingDomain = getEditingDomain(mainSetting); if (editingDomain == null) { return null; } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, modelElement, mainSetting.getEStructuralFeature(), instance)); return instance; }

Target:
protected void addRow(EClass clazz, Setting mainSetting) { if (clazz.isAbstract() || clazz.isInterface()) { Activator .getInstance() .getLog() .log( new Status( IStatus.WARNING, "org.eclipse.emf.ecp.view.table.ui.swt", "The class " + clazz.getName() + " is abstract or an interface.")); } final EObject modelElement = mainSetting.getEObject(); final EObject instance = clazz.getEPackage().getEFactoryInstance().create(clazz); final EditingDomain editingDomain = getEditingDomain(mainSetting); if (editingDomain == null) { } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, modelElement, mainSetting.getEStructuralFeature(), instance)); }
Source:
public String getBuildNumber() { return properties.get("build.number"); }

Target:
public String getBuildNumber() { return properties.get(BuildInfoFields.BUILD_NUMBER); }
Source:
public void whenGetEventsWithUknownTopicThenTopicNotFound() { given() .param("batch_limit", "5") .param("stream_timeout", "1") .when() .get(createStreamEndpointUrl("blah-topic")) .then() .statusCode(HttpStatus.NOT_FOUND.value()) .and() .body("detail", equalTo("topic not found")); }

Target:
public void whenGetEventsWithUknownTopicThenTopicNotFound() { given() .when() .get(createStreamEndpointUrl("blah-topic")) .then() .statusCode(HttpStatus.NOT_FOUND.value()) .and() .body("detail", equalTo("topic not found")); }
Source:
public AtsProgramArtifactToken(Long id, String name, ArtifactTypeToken artifactType) { super(id, GUID.create(), name, CoreBranches.COMMON, artifactType); }

Target:
public AtsProgramArtifactToken(Long id, String name, ArtifactTypeToken artifactType) { super(id, name, CoreBranches.COMMON, artifactType); }
Source:
public IvParameterSpec getIV(){ return iv; }

Target:
public IvParameterSpec getIV(){ if(!type.hasIV()){ throw new UnsupportedTypeException(type); } return iv; }
Source:
public void parsePom(File file) { try { parsePom(new FileInputStream(file)); } catch (FileNotFoundException ex) { LOGGER.error("Error while opening POM file", ex); } }

Target:
public void parsePom(File file) { try (FileInputStream fileInputStream = new FileInputStream(file)) { parsePom(fileInputStream); } catch (IOException ex) { LOGGER.error("Error while reading POM file", ex); } }
Source:
protected Hits<SnomedRefSetMemberIndexEntry> filter(Hits<SnomedRefSetMemberIndexEntry> allResults) throws IOException { Multimap<String, SnomedRefSetMemberIndexEntry> referencedComponentToMemberMap = ArrayListMultimap.create(); allResults.getHits().forEach(m -> referencedComponentToMemberMap.put(m.getReferencedComponentId(), m)); Query<String> query = Query.selectPartial(String.class, SnomedDescriptionIndexEntry.class, singleton(SnomedDescriptionIndexEntry.Fields.ID)) .where(Expressions.builder() .must(SnomedDescriptionIndexEntry.Expressions.ids(referencedComponentToMemberMap.keySet())) .filter(SnomedDescriptionIndexEntry.Expressions.languageCode(languageCode)) .build()) .limit(referencedComponentToMemberMap.keySet().size()) .build(); List<String> descriptionIdsWithLanguageCode = getRevisionSearcher().search(query).getHits(); List<SnomedRefSetMemberIndexEntry> filteredMembers = descriptionIdsWithLanguageCode.stream() .flatMap(id -> referencedComponentToMemberMap.get(id).stream()) .collect(toList()); return new Hits<SnomedRefSetMemberIndexEntry>(filteredMembers, allResults.getOffset(), allResults.getLimit(), allResults.getTotal()); }

Target:
protected Hits<SnomedRefSetMemberIndexEntry> filter(Hits<SnomedRefSetMemberIndexEntry> allResults) throws IOException { Multimap<String, SnomedRefSetMemberIndexEntry> referencedComponentToMemberMap = ArrayListMultimap.create(); allResults.getHits().forEach(m -> referencedComponentToMemberMap.put(m.getReferencedComponentId(), m)); Query<String> query = Query.selectPartial(String.class, SnomedDescriptionIndexEntry.class, singleton(SnomedDescriptionIndexEntry.Fields.ID)) .where(Expressions.builder() .filter(SnomedDescriptionIndexEntry.Expressions.ids(referencedComponentToMemberMap.keySet())) .filter(SnomedDescriptionIndexEntry.Expressions.languageCode(languageCode)) .build()) .limit(referencedComponentToMemberMap.keySet().size()) .build(); List<String> descriptionIdsWithLanguageCode = getRevisionSearcher().search(query).getHits(); List<SnomedRefSetMemberIndexEntry> filteredMembers = descriptionIdsWithLanguageCode.stream() .flatMap(id -> referencedComponentToMemberMap.get(id).stream()) .collect(toList()); return new Hits<SnomedRefSetMemberIndexEntry>(filteredMembers, allResults.getOffset(), allResults.getLimit(), allResults.getTotal()); }
Source:
public void logsProblem() throws Exception { final RqFallback req = new RqFallback.Fake( HttpURLConnection.HTTP_NOT_FOUND ); MatcherAssert.assertThat( new FbLog4j().route(req).has(), Matchers.is(false) ); }

Target:
public void logsProblem() throws Exception { final ByteArrayOutputStream baos = this.setUpLoggerStream(); final RqFallback req = new RqFallback.Fake( HttpURLConnection.HTTP_NOT_FOUND ); MatcherAssert.assertThat( new FbLog4j().route(req).has(), Matchers.is(false) ); MatcherAssert.assertThat( new String(baos.toByteArray()), Matchers.stringContainsInOrder( Arrays.asList("ERROR", "failed with") ) ); }
Source:
public PermissionEditor(ProjectAccess projectAccess, boolean readOnly, AccessSection section, LabelTypes labelTypes) { this.readOnly = readOnly; this.section = section; this.projectName = projectAccess.getProjectName(); this.labelTypes = labelTypes; normalName = new ValueLabel<String>(new PermissionNameRenderer(projectAccess.getCapabilities())); deletedName = new ValueLabel<String>(new PermissionNameRenderer(projectAccess.getCapabilities())); initWidget(uiBinder.createAndBindUi(this)); groupToAdd.setProject(projectName); rules = ListEditor.of(new RuleEditorSource()); exclusiveGroup.setEnabled(!readOnly); exclusiveGroup.setVisible(RefConfigSection .isValid(section.getName())); if (readOnly) { addContainer.removeFromParent(); addContainer = null; deletePermission.removeFromParent(); deletePermission = null; } }

Target:
public PermissionEditor(ProjectAccess projectAccess, boolean readOnly, AccessSection section, LabelTypes labelTypes) { this.readOnly = readOnly; this.section = section; this.projectName = projectAccess.getProjectName(); this.labelTypes = labelTypes; PermissionNameRenderer nameRenderer = new PermissionNameRenderer(projectAccess.getCapabilities()); normalName = new ValueLabel<String>(nameRenderer); deletedName = new ValueLabel<String>(nameRenderer); initWidget(uiBinder.createAndBindUi(this)); groupToAdd.setProject(projectName); rules = ListEditor.of(new RuleEditorSource()); exclusiveGroup.setEnabled(!readOnly); exclusiveGroup.setVisible(RefConfigSection .isValid(section.getName())); if (readOnly) { addContainer.removeFromParent(); addContainer = null; deletePermission.removeFromParent(); deletePermission = null; } }
Source:
public synchronized void parse(InputStream stream, IProgressMonitor monitor) throws IOException { this.status = null; setProgressMonitor(monitor); monitor.beginTask(Messages.repo_loading, IProgressMonitor.UNKNOWN); try { getParser(); InstallableUnitsHandler handler = new InstallableUnitsHandler(); xmlReader.setContentHandler(mode.equals(PARSER_MODE.REPO) ? new RepositoryDocHandler(INSTALLABLE_UNITS_ELEMENT, handler) : handler); xmlReader.parse(new InputSource(stream)); if (isValidXML()) { units = handler.getUnits(); } } catch (SAXException e) { if (!(e.getException() instanceof OperationCanceledException)) throw new IOException(e.getMessage()); } catch (ParserConfigurationException e) { throw new IOException(e.getMessage()); } finally { monitor.done(); stream.close(); } }

Target:
public synchronized void parse(InputStream stream, IProgressMonitor monitor) throws IOException { this.status = null; setProgressMonitor(monitor); monitor.beginTask(Messages.repo_loading, IProgressMonitor.UNKNOWN); try { getParser(); InstallableUnitsHandler handler = new InstallableUnitsHandler(); if (mode.equals(PARSER_MODE.REPO)) xmlReader.setContentHandler(new RepositoryDocHandler(INSTALLABLE_UNITS_ELEMENT, handler)); else xmlReader.setContentHandler(handler); xmlReader.parse(new InputSource(stream)); if (isValidXML()) { units = handler.getUnits(); } } catch (SAXException e) { if (!(e.getException() instanceof OperationCanceledException)) throw new IOException(e.getMessage()); } catch (ParserConfigurationException e) { throw new IOException(e.getMessage()); } finally { monitor.done(); stream.close(); } }
Source:
public SignaturePad(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a = context.getTheme().obtainStyledAttributes( attrs, R.styleable.SignaturePad, 0, 0); try { mMinWidth = a.getDimensionPixelSize(R.styleable.SignaturePad_minWidth, convertDpToPx(3)); mMaxWidth = a.getDimensionPixelSize(R.styleable.SignaturePad_maxWidth, convertDpToPx(7)); mVelocityFilterWeight = a.getFloat(R.styleable.SignaturePad_velocityFilterWeight, 0.9f); mIsDoubleClick = a.getBoolean(R.styleable.SignaturePad_isDoubleClick, true); mPaint.setColor(a.getColor(R.styleable.SignaturePad_penColor, Color.BLACK)); } finally { a.recycle(); } mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeJoin(Paint.Join.ROUND); mDirtyRect = new RectF(); clear(); }

Target:
public SignaturePad(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a = context.getTheme().obtainStyledAttributes( attrs, R.styleable.SignaturePad, 0, 0); try { mMinWidth = a.getDimensionPixelSize(R.styleable.SignaturePad_minWidth, convertDpToPx(3)); mMaxWidth = a.getDimensionPixelSize(R.styleable.SignaturePad_maxWidth, convertDpToPx(7)); mVelocityFilterWeight = a.getFloat(R.styleable.SignaturePad_velocityFilterWeight, 0.9f); mClearOnDoubleClick = a.getBoolean(R.styleable.SignaturePad_clearOnDoubleClick, false); mPaint.setColor(a.getColor(R.styleable.SignaturePad_penColor, Color.BLACK)); } finally { a.recycle(); } mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeJoin(Paint.Join.ROUND); mDirtyRect = new RectF(); clear(); }
Source:
public String name() { return "uncompress-request"; }

Target:
public String name() { return "uncompress"; }
Source:
public void start() { synchronized (lock) { if (!started.getAndSet(true)) { if (lookupSnapshot != null) { final List<LookupBean> lookupBeanList = lookupSnapshot.pullExistingSnapshot(); for (LookupBean lookupBean : lookupBeanList ) { this.put(lookupBean.name, lookupBean.factory); } if (lookupConfig.getSnapshotPeriod().getMillis() != 0) { executor.scheduleAtFixedRate( new Runnable() { @Override public void run() { try { LOGGER.debug("taking snapshot"); lookupSnapshot.takeSnapshot(getAllAsList()); } catch (Exception e) { LOGGER.error(e, "Exception during periodic snapshot"); } } }, lookupConfig.getSnapshotPeriod().toStandardDuration().getMillis(), lookupConfig.getSnapshotPeriod().toStandardDuration().getMillis(), TimeUnit.MILLISECONDS ); } } LOGGER.info("Started lookup factory references manager"); } } }

Target:
public void start() { synchronized (lock) { if (!started.getAndSet(true)) { if (lookupSnapshotTaker != null) { final List<LookupBean> lookupBeanList = lookupSnapshotTaker.pullExistingSnapshot(); for (LookupBean lookupBean : lookupBeanList) { this.put(lookupBean.name, lookupBean.factory); } } LOGGER.info("Started lookup factory references manager"); } } }
Source:
private void upsertData(String tenantId) throws SQLException { for (int u = 1; u <= NUM_USERS; u++) { String userId = "user" + userNum++; int age = RANDOM.nextInt(99) + 1; if(tenantId.equals(sourceOnlyTenant) || tenantId.equals(sourceAndTargetTenant)) { upsertData(sourceStmt, tenantId, userId, age); if (u == 1 || u == 5) { sourceSplitPoints.add(ByteUtil.concat(Bytes.toBytes(tenantId), QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(userId))); } } if (tenantId.equals(sourceAndTargetTenant) || tenantId.equals(targetOnlyTenant)) { upsertData(targetStmt, tenantId, userId, age); if (u == 1) { targetSplitPoints.add(ByteUtil.concat(Bytes.toBytes(tenantId), QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(userId))); } } } }

Target:
private void upsertData(String tenantId) throws SQLException { for (int u = 1; u <= NUM_USERS; u++) { String userId = "user" + userNum++; int age = RANDOM.nextInt(99) + 1; if(tenantId.equals(sourceOnlyTenant) || tenantId.equals(sourceAndTargetTenant)) { upsertData(sourceStmt, tenantId, userId, age); if (u == 1 || u == NUM_USERS/2) { sourceSplitPoints.add(ByteUtil.concat(Bytes.toBytes(tenantId), QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(userId))); } } if (tenantId.equals(sourceAndTargetTenant) || tenantId.equals(targetOnlyTenant)) { upsertData(targetStmt, tenantId, userId, age); if (u == 1) { targetSplitPoints.add(ByteUtil.concat(Bytes.toBytes(tenantId), QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(userId))); } } } }
Source:
public IStreamView get(UUID stream, StreamOptions options) { IStreamView streamView = runtime.getLayoutView().getLayout().getLatestSegment() .getReplicationMode().getStreamView(runtime, stream, options); return streamView; }

Target:
public IStreamView get(UUID stream, StreamOptions options) { IStreamView streamView = runtime.getLayoutView().getLayout().getLatestSegment() .getReplicationMode().getStreamView(runtime, stream, options); streamCache.put(stream, streamView); return streamView; }
Source:
public void shouldNotCreateDirectoryForNonNativeTableInDumpDirectory() throws Throwable { String createTableQuery = "CREATE TABLE custom_serdes( serde_id bigint COMMENT 'from deserializer', name string " + "COMMENT 'from deserializer', slib string COMMENT 'from deserializer') " + "ROW FORMAT SERDE 'org.apache.hive.storage.jdbc.JdbcSerDe' " + "STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' " + "WITH SERDEPROPERTIES ('serialization.format'='1') " + "TBLPROPERTIES ( " + "'hive.sql.database.type'='METASTORE', " + "'hive.sql.query'='SELECT \"SERDE_ID\", \"NAME\", \"SLIB\" FROM \"SERDES\"')"; WarehouseInstance.Tuple bootstrapTuple = primary .run("use " + primaryDbName) .run(createTableQuery).dump(primaryDbName, null); Path cSerdesTableDumpLocation = new Path(bootstrapTuple.dumpLocation + Path.SEPARATOR + primaryDbName + Path.SEPARATOR + "custom_serdes"); FileSystem fs = cSerdesTableDumpLocation.getFileSystem(primary.hiveConf); assertFalse(fs.exists(cSerdesTableDumpLocation)); }

Target:
public void shouldNotCreateDirectoryForNonNativeTableInDumpDirectory() throws Throwable { String createTableQuery = "CREATE TABLE custom_serdes( serde_id bigint COMMENT 'from deserializer', name string " + "COMMENT 'from deserializer', slib string COMMENT 'from deserializer') " + "ROW FORMAT SERDE 'org.apache.hive.storage.jdbc.JdbcSerDe' " + "STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' " + "WITH SERDEPROPERTIES ('serialization.format'='1') " + "TBLPROPERTIES ( " + "'hive.sql.database.type'='METASTORE', " + "'hive.sql.query'='SELECT \"SERDE_ID\", \"NAME\", \"SLIB\" FROM \"SERDES\"')"; WarehouseInstance.Tuple bootstrapTuple = primary .run("use " + primaryDbName) .run(createTableQuery).dump(primaryDbName, null); Path cSerdesTableDumpLocation = new Path( new Path(bootstrapTuple.dumpLocation, primaryDbName), "custom_serdes"); FileSystem fs = cSerdesTableDumpLocation.getFileSystem(primary.hiveConf); assertFalse(fs.exists(cSerdesTableDumpLocation)); }