auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void VEGalleryTests_002_GalleryCart() { int numOfMedias = 7; int numToRemoveFirst = 1; int numToRemoveSecond = 2; int numToAdd = 2; articleName = PageContent.ARTICLE_NAME_PREFIX + article.getTimeStamp(); VisualEditorPageObject ve = article.launchVisualEditorWithMainEdit(articleName, wikiURL); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); VisualEditorInsertGalleryDialog galleryDialog = (VisualEditorInsertGalleryDialog) ve.openDialogFromMenu(InsertDialog.GALLERY); galleryDialog = galleryDialog.searchMedia("he"); galleryDialog.addMediaToCart(numOfMedias); galleryDialog.verifyNumOfCartItems(numOfMedias); galleryDialog.removeMediaFromCart(numToRemoveFirst); numOfMedias = numOfMedias - numToRemoveFirst; galleryDialog.verifyNumOfCartItems(numOfMedias); galleryDialog = galleryDialog.searchMedia("a"); galleryDialog.addMediaToCart(numToAdd); numOfMedias = numOfMedias + numToAdd; galleryDialog.verifyNumOfCartItems(numOfMedias); galleryDialog = galleryDialog.searchMedia("he"); galleryDialog.removeMediaFromCart(numToRemoveSecond); numOfMedias = numOfMedias - numToRemoveSecond; galleryDialog.verifyNumOfCartItems(numOfMedias); }

Target:
public void VEGalleryTests_002_GalleryCart() { final int NUM_OF_MEDIA_TO_REMOVE_FIRST = 1; final int NUM_OF_MEDIA_TO_REMOVE_SECOND = 2; final int NUM_OF_MEDIA_TO_ADD = 2; final int INITIAL_NUM_OF_MEDIA = 7; int expectedNumOfMedia = INITIAL_NUM_OF_MEDIA; articleName = PageContent.ARTICLE_NAME_PREFIX + article.getTimeStamp(); VisualEditorPageObject ve = article.launchVisualEditorWithMainEdit(articleName, wikiURL); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); VisualEditorInsertGalleryDialog galleryDialog = (VisualEditorInsertGalleryDialog) ve.openDialogFromMenu(InsertDialog.GALLERY); galleryDialog = galleryDialog.searchMedia("he"); galleryDialog.addMediaToCart(INITIAL_NUM_OF_MEDIA); galleryDialog.verifyNumOfCartItems(expectedNumOfMedia); galleryDialog.removeMediaFromCart(NUM_OF_MEDIA_TO_REMOVE_FIRST); expectedNumOfMedia = expectedNumOfMedia - NUM_OF_MEDIA_TO_REMOVE_FIRST; galleryDialog.verifyNumOfCartItems(expectedNumOfMedia); galleryDialog = galleryDialog.searchMedia("a"); galleryDialog.addMediaToCart(NUM_OF_MEDIA_TO_ADD); expectedNumOfMedia = expectedNumOfMedia + NUM_OF_MEDIA_TO_ADD; galleryDialog.verifyNumOfCartItems(expectedNumOfMedia); galleryDialog = galleryDialog.searchMedia("he"); galleryDialog.removeMediaFromCart(NUM_OF_MEDIA_TO_REMOVE_SECOND); expectedNumOfMedia = expectedNumOfMedia - NUM_OF_MEDIA_TO_REMOVE_SECOND; galleryDialog.verifyNumOfCartItems(expectedNumOfMedia); }
Source:
public List<Object> getAll(List<Object> keys) { List<Object> values = new ArrayList<Object>(); try { final Map<Object, Object> entries = getRegion().getAll(keys); for (int i = 0; i < keys.size(); i++) { values.add(entries.get(keys.get(i))); } } catch (IOException ex) { LOG.info("error getting region ", ex); } return (values); }

Target:
public List<Object> getAll(List<Object> keys) { List<Object> values = new ArrayList<Object>(); try { final Map<Object, Object> entries = getRegion().getAll(keys); for (int i = 0; i < keys.size(); i++) { values.add(entries.get(keys.get(i))); } } catch (IOException ex) { logger.info("error getting region ", ex); } return (values); }
Source:
public ByteBufferImpl readObject(ObjectInput input) throws IOException, ClassNotFoundException { int length = UnsignedNumeric.readUnsignedInt(input); byte[] data = new byte[length]; input.read(data, 0, length); return new ByteBufferImpl(data, 0, length); }

Target:
public ByteBufferImpl readObject(ObjectInput input) throws IOException, ClassNotFoundException { int length = UnsignedNumeric.readUnsignedInt(input); byte[] data = new byte[length]; input.readFully(data, 0, length); return new ByteBufferImpl(data, 0, length); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_edit: FragUtils.replaceBackStack(R.id.container, EditAnnouncementFragment.newInstance(mAnnouncement), getActivity()); break; case R.id.menu_delete: Requests.Announcements.with(getActivity()).makeDeleteRequest(mAnnouncement); break; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_edit: FragUtils.replaceBackStack(R.id.container, EditAnnouncementFragment.newInstance(mAnnouncement), getActivity()); break; case R.id.menu_delete: confirmDelete(); break; } return super.onOptionsItemSelected(item); }
Source:
public void onMessage(String data) { try { Map<String, Object> dataMap = objectMapper.readValue(data, new TypeReference<Map<String, Object>>() {}); String event = (String) dataMap.get("event"); if ("KEEP_ALIVE".equals(event)) { return; } String type = (String) dataMap.get("type"); if (type == null) { log.debug("type missing so ignoring message. {}", dataMap); return; } if (type.equals("authenticated")) { log.info("WebSocket connection authenticated as (in {})", dataMap.get("userId"), dataMap.get("orgId")); } else { String channelName = (String) dataMap.get("channel"); if (channelName != null) { TransportChannel channel = channels.get(channelName); if ((channel != null) && (!channel.isClosed())) { StreamMessage message = new StreamMessage(type, null, data); channel.offer(message); } else { log.debug("ignoring message. channel not found {}", channelName); } } } } catch (IOException ex) { log.error("failed to process messages", ex); } }

Target:
public void onMessage(String data) { try { Map<String, Object> dataMap = objectMapper.readValue(data, MAP_TYPE_REF); String event = (String) dataMap.get("event"); if ("KEEP_ALIVE".equals(event)) { return; } String type = (String) dataMap.get("type"); if (type == null) { log.debug("type missing so ignoring message. {}", dataMap); return; } if (type.equals("authenticated")) { log.info("WebSocket connection authenticated as (in {})", dataMap.get("userId"), dataMap.get("orgId")); } else { String channelName = (String) dataMap.get("channel"); if (channelName != null) { TransportChannel channel = channels.get(channelName); if ((channel != null) && (!channel.isClosed())) { StreamMessage message = new StreamMessage(type, null, data); channel.offer(message); } else { log.debug("ignoring message. channel not found {}", channelName); } } } } catch (IOException ex) { log.error("failed to process messages", ex); } }
Source:
public void testCustomMessageWhileSpiIsStopping() throws Exception { List<DummyCustomDiscoveryMessage> messages = new CopyOnWriteArrayList<>(); IgniteEx coord = startGrid("coordinator"); IgniteEx node1 = startGrid("node1"); IgniteEx node2 = startGrid("node2"); CustomEventListener<DummyCustomDiscoveryMessage> listener = new CustomEventListener<DummyCustomDiscoveryMessage>() { @Override public void onCustomEvent( AffinityTopologyVersion topVer, ClusterNode snd, DummyCustomDiscoveryMessage msg) { messages.add(msg); } }; coord.context().discovery().setCustomEventListener(DummyCustomDiscoveryMessage.class, listener); node1.context().discovery().setCustomEventListener(DummyCustomDiscoveryMessage.class, listener); node2.context().discovery().setCustomEventListener(DummyCustomDiscoveryMessage.class, listener); coord.cluster().active(true); TcpDiscoverySpi coordDisco = (TcpDiscoverySpi)coord.configuration().getDiscoverySpi(); TcpDiscoverySpi nodeDisco = (TcpDiscoverySpi)node1.configuration().getDiscoverySpi(); TcpDiscoveryImpl impl = (TcpDiscoveryImpl)Whitebox.getInternalState(nodeDisco, "impl"); Whitebox.setInternalState(impl, "spiState", TcpDiscoverySpiState.DISCONNECTING); sendDummyCustomMessage(coordDisco, IgniteUuid.randomUuid()); stopAllGrids(); assertEquals(3, messages.size()); }

Target:
public void testCustomMessageWhileSpiIsStopping() throws Exception { List<DummyCustomDiscoveryMessage> messages = new CopyOnWriteArrayList<>(); startGrids(3); CustomEventListener<DummyCustomDiscoveryMessage> listener = new CustomEventListener<DummyCustomDiscoveryMessage>() { @Override public void onCustomEvent( AffinityTopologyVersion topVer, ClusterNode snd, DummyCustomDiscoveryMessage msg) { messages.add(msg); } }; G.allGrids().forEach(new Consumer<Ignite>() { @Override public void accept(Ignite ignite) { ((IgniteEx)ignite) .context() .discovery() .setCustomEventListener(DummyCustomDiscoveryMessage.class, listener); } }); grid(0).cluster().active(true); TcpDiscoverySpi coordDisco = (TcpDiscoverySpi)grid(0).configuration().getDiscoverySpi(); TcpDiscoverySpi nodeDisco = (TcpDiscoverySpi)grid(1).configuration().getDiscoverySpi(); TcpDiscoveryImpl impl = (TcpDiscoveryImpl)Whitebox.getInternalState(nodeDisco, "impl"); Whitebox.setInternalState(impl, "spiState", TcpDiscoverySpiState.DISCONNECTING); sendDummyCustomMessage(coordDisco, IgniteUuid.randomUuid()); GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { return messages.size() == 3; } }, 10000); stopAllGrids(); }
Source:
public void extractResults(Iterable<byte[]> canonicalRows, Map<ByteBuffer, List<ColumnOrSuperColumn>> colsByKey, long startTs) { Map<Sha256Hash, byte[]> canonicalRowsByHash = Maps.uniqueIndex(canonicalRows, Sha256Hash::computeHash); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> colEntry : colsByKey.entrySet()) { byte[] rawRow = CassandraKeyValueServices.getBytesFromByteBuffer(colEntry.getKey()); byte[] row = canonicalRowsByHash.get(Sha256Hash.computeHash(rawRow)); List<ColumnOrSuperColumn> columns = colEntry.getValue(); updateAppropriateDataStructures(row, columns); for (ColumnOrSuperColumn c : columns) { Pair<byte[], Long> pair = CassandraKeyValueServices.decomposeName(c.getColumn()); internalExtractResult(startTs, row, pair.lhSide, c.getColumn().getValue(), pair.rhSide); } } }

Target:
public void extractResults(Iterable<byte[]> canonicalRows, Map<ByteBuffer, List<ColumnOrSuperColumn>> colsByKey, long startTs) { Map<Sha256Hash, byte[]> canonicalRowsByHash = Maps.uniqueIndex(canonicalRows, Sha256Hash::computeHash); for (Map.Entry<ByteBuffer, List<ColumnOrSuperColumn>> colEntry : colsByKey.entrySet()) { byte[] rawRow = CassandraKeyValueServices.getBytesFromByteBuffer(colEntry.getKey()); byte[] row = canonicalRowsByHash.get(Sha256Hash.computeHash(rawRow)); List<ColumnOrSuperColumn> columns = colEntry.getValue(); if (!columns.isEmpty()) { rowsToLastCompositeColumns.put(row, columns.get(columns.size() - 1).getColumn()); } else { emptyRows.add(row); } rowsToRawColumnCount.put(row, columns.size()); for (ColumnOrSuperColumn c : columns) { Pair<byte[], Long> pair = CassandraKeyValueServices.decomposeName(c.getColumn()); internalExtractResult(startTs, row, pair.lhSide, c.getColumn().getValue(), pair.rhSide); } } }
Source:
public void analyze() { for ( Node node : nodes.values() ) { depthFirstSearch( node ); } }

Target:
private void analyze() { for ( Node node : nodes.values() ) { depthFirstSearch( node ); } }
Source:
public void filter(final MethodNode methodNode, final IFilterContext context, final IFilterOutput output) { if (context.getSourceDebugExtension() == null) { return; } if (!context.getClassAnnotations() .contains(KotlinGeneratedFilter.KOTLIN_METADATA_DESC)) { return; } final int max = parseSMAP(context.getSourceDebugExtension()); int line = 0; for (AbstractInsnNode i = methodNode.instructions .getFirst(); i != null; i = i.getNext()) { if (AbstractInsnNode.LINE == i.getType()) { line = ((LineNumberNode) i).line; } if (line >= max) { output.ignore(i, i); } } }

Target:
public void filter(final MethodNode methodNode, final IFilterContext context, final IFilterOutput output) { if (context.getSourceDebugExtension() == null) { return; } if (!KotlinGeneratedFilter.isKotlinClass(context)) { return; } if (firstGeneratedLineNumber == -1) { firstGeneratedLineNumber = getFirstGeneratedLineNumber( context.getSourceFileName(), context.getSourceDebugExtension()); } int line = 0; for (AbstractInsnNode i = methodNode.instructions .getFirst(); i != null; i = i.getNext()) { if (AbstractInsnNode.LINE == i.getType()) { line = ((LineNumberNode) i).line; } if (line >= firstGeneratedLineNumber) { output.ignore(i, i); } } }
Source:
public Map<Integer, String> getColumnNames() { return m_colNames; }

Target:
public Map<Integer, String> getColumnNames() { return ImmutableSortedMap.copyOf(m_colNames); }
Source:
public PartSite(MPart model, IWorkbenchPart part, IWorkbenchPartReference ref, IConfigurationElement element) { this.model = model; this.part = part; this.partReference = ref; this.element = element; MElementContainer<?> parent = (MElementContainer<?>) ((EObject) model).eContainer(); while (!(parent instanceof MWindow)) { parent = (MElementContainer<?>) ((EObject) parent).eContainer(); } setWindow((MWindow) parent); e4Context = model.getContext(); IServiceLocatorCreator slc = (IServiceLocatorCreator) e4Context .get(IServiceLocatorCreator.class.getName()); IWorkbenchWindow workbenchWindow = getWorkbenchWindow(); this.serviceLocator = (ServiceLocator) slc.createServiceLocator(workbenchWindow, null, new IDisposable() { public void dispose() { } }, e4Context); initializeDefaultServices(); e4Context.set(IWorkbenchPart.class, part); e4Context.set(IStatusLineManager.class.getName(), new ContextFunction() { @Override public Object compute(IEclipseContext context, String contextKey) { return getActionBars().getStatusLineManager(); } }); }

Target:
public PartSite(MPart model, IWorkbenchPart part, IWorkbenchPartReference ref, IConfigurationElement element) { this.model = model; this.part = part; this.partReference = ref; this.element = element; MElementContainer<?> parent = (MElementContainer<?>) ((EObject) model).eContainer(); while (!(parent instanceof MWindow)) { parent = (MElementContainer<?>) ((EObject) parent).eContainer(); } setWindow((MWindow) parent); e4Context = model.getContext(); IServiceLocatorCreator slc = (IServiceLocatorCreator) e4Context .get(IServiceLocatorCreator.class.getName()); IWorkbenchWindow workbenchWindow = getWorkbenchWindow(); this.serviceLocator = (ServiceLocator) slc.createServiceLocator(workbenchWindow, null, new IDisposable() { public void dispose() { } }, e4Context); initializeDefaultServices(); }
Source:
public ItemStack insertItem( int slot, ItemStack stack, boolean simulate ) { if( stack.isEmpty() ) { return ItemStack.EMPTY; } ItemStack existing = getStackInSlot( slot ); int limit = getStackLimit( slot, stack ); if( !existing.isEmpty() ) { if( !ItemHandlerHelper.canItemStacksStack( stack, existing ) ) return stack; limit -= existing.getCount(); } if( limit <= 0 ) return stack; boolean reachedLimit = stack.getCount() > limit; if( !simulate ) { if( existing.isEmpty() ) { this.inv[slot] = AEApi.instance().storage().createItemStack( reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack ); } else { existing.grow( reachedLimit ? limit : stack.getCount() ); } if( this.te != null && Platform.isServer() ) { this.te.onChangeInventory( this, slot, InvOperation.insert, ItemStack.EMPTY, reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack ); } } return reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, stack.getCount() - limit ) : ItemStack.EMPTY; }

Target:
public ItemStack insertItem( int slot, ItemStack stack, boolean simulate ) { if( stack.isEmpty() ) { return ItemStack.EMPTY; } ItemStack existing = getStackInSlot( slot ); int limit = getStackLimit( slot, stack ); if( !existing.isEmpty() ) { if( !ItemHandlerHelper.canItemStacksStack( stack, existing ) ) { return stack; } limit -= existing.getCount(); } if( limit <= 0 ) { return stack; } boolean reachedLimit = stack.getCount() > limit; if( !simulate ) { if( existing.isEmpty() ) { this.inv[slot] = AEApi.instance().storage().createItemStack( reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack ); } else { existing.grow( reachedLimit ? limit : stack.getCount() ); } fireOnChangeInventory( slot, InvOperation.INSERT, ItemStack.EMPTY, reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, limit ) : stack ); } return reachedLimit ? ItemHandlerHelper.copyStackWithSize( stack, stack.getCount() - limit ) : ItemStack.EMPTY; }
Source:
public void testIntersect() throws Exception { conn.tableOperations().create(tableName); BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig()); Mutation m = new Mutation("part1"); m.put("bar", "doc1", "value"); m.put("bar", "doc2", "value"); m.put("dog", "doc3", "value"); m.put("foo", "doc2", "value"); m.put("foo", "doc3", "value"); bw.addMutation(m); m = new Mutation("part2"); m.put("bar", "DOC1", "value"); m.put("bar", "DOC2", "value"); m.put("dog", "DOC3", "value"); m.put("foo", "DOC2", "value"); m.put("foo", "DOC3", "value"); bw.addMutation(m); bw.flush(); final ClientSideIteratorScanner csis = new ClientSideIteratorScanner(conn.createScanner(tableName, new Authorizations())); final IteratorSetting si = new IteratorSetting(10, tableName, IntersectingIterator.class); IntersectingIterator.setColumnFamilies(si, new Text[] {new Text("bar"), new Text("foo")}); csis.addScanIterator(si); csis.close(); checkResults(csis, resultSet3, PartialKey.ROW_COLFAM_COLQUAL); }

Target:
public void testIntersect() throws Exception { conn.tableOperations().create(tableName); BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig()); Mutation m = new Mutation("part1"); m.put("bar", "doc1", "value"); m.put("bar", "doc2", "value"); m.put("dog", "doc3", "value"); m.put("foo", "doc2", "value"); m.put("foo", "doc3", "value"); bw.addMutation(m); m = new Mutation("part2"); m.put("bar", "DOC1", "value"); m.put("bar", "DOC2", "value"); m.put("dog", "DOC3", "value"); m.put("foo", "DOC2", "value"); m.put("foo", "DOC3", "value"); bw.addMutation(m); bw.flush(); final IteratorSetting si = new IteratorSetting(10, tableName, IntersectingIterator.class); try (ClientSideIteratorScanner csis = new ClientSideIteratorScanner(conn.createScanner(tableName, new Authorizations()))) { IntersectingIterator.setColumnFamilies(si, new Text[] {new Text("bar"), new Text("foo")}); csis.addScanIterator(si); checkResults(csis, resultSet3, PartialKey.ROW_COLFAM_COLQUAL); } }
Source:
private String getJMXUrlForProcessRegex(String processRegex) throws com.sun.tools.attach.AttachNotSupportedException, IOException { for (com.sun.tools.attach.VirtualMachineDescriptor vmd : com.sun.tools.attach.VirtualMachine.list()) { if (vmd.displayName().matches(processRegex)) { LOGGER.info("Matched JVM '" + vmd.displayName() + "' against regex '" + processRegex + "'"); com.sun.tools.attach.VirtualMachine vm = com.sun.tools.attach.VirtualMachine.attach(vmd); String connectorAddress = vm.getAgentProperties().getProperty(CONNECTOR_ADDRESS); if (connectorAddress == null) { loadJMXAgent(vm); connectorAddress = vm.getAgentProperties().getProperty( CONNECTOR_ADDRESS); } return connectorAddress; } } List<String> jvms = new ArrayList<String>(); for (com.sun.tools.attach.VirtualMachineDescriptor vmd : com.sun.tools.attach.VirtualMachine.list()) { jvms.add( vmd.displayName() ); } throw new IOException("Cannot find JVM matching regex: '" + processRegex + "'; available JVMs (for this user account): " + jvms ); }

Target:
private String getJMXUrlForProcessRegex(String processRegex) throws com.sun.tools.attach.AttachNotSupportedException, IOException { List<String> jvms = new ArrayList<String>(); for (com.sun.tools.attach.VirtualMachineDescriptor vmd : com.sun.tools.attach.VirtualMachine.list()) { if (vmd.displayName().matches(processRegex)) { com.sun.tools.attach.VirtualMachine vm = com.sun.tools.attach.VirtualMachine.attach(vmd); LOGGER.info("Matched JVM '" + vmd.displayName() + "' against regex '" + processRegex + "'"); String connectorAddress = vm.getAgentProperties().getProperty(CONNECTOR_ADDRESS); if (connectorAddress == null) { loadJMXAgent(vm); connectorAddress = vm.getAgentProperties().getProperty( CONNECTOR_ADDRESS); } return connectorAddress; } jvms.add( vmd.displayName() ); } throw new IOException("Cannot find JVM matching regex: '" + processRegex + "'; available JVMs (for this user account): " + jvms ); }
Source:
private void getReport(MetricGroupNode metricGroupNode, Long testId) { try { if (metricGroupNode.getMetricGroupNodeList() != null) { for (MetricGroupNode metricGroup : (List<MetricGroupNode>) metricGroupNode.getMetricGroupNodeList()) getReport(metricGroup, testId); } if (metricGroupNode.getMetricsWithoutChildren() != null) { String groupTitle = metricGroupNode.getDisplayName(); for (MetricNode node : (List<MetricNode>) metricGroupNode.getMetricsWithoutChildren()) { if (plotsReal.get(node).getPlotSeries().isEmpty()) continue; if (!plots.containsKey(testId)) plots.put(testId, new MetricPlotDTOs()); plots.get(testId).getMetricPlotDTOs().add(new MetricPlotDTO(node.getDisplayName(), node.getDisplayName(), groupTitle, makePlot(plotsReal.get(node)))); groupTitle = ""; } } } catch (Exception e) { log.error("Unable to take plot information about {}", metricGroupNode.getDisplayName()); } }

Target:
private void getReport(MetricGroupNode metricGroupNode, Long testId) { try { if (metricGroupNode.getMetricGroupNodeList() != null) { for (MetricGroupNode metricGroup : (List<MetricGroupNode>) metricGroupNode.getMetricGroupNodeList()) getReport(metricGroup, testId); } if (metricGroupNode.getMetricsWithoutChildren() != null) { String groupTitle = metricGroupNode.getDisplayName(); for (MetricNode node : (List<MetricNode>) metricGroupNode.getMetricsWithoutChildren()) { if (plotsReal.get(node).getPlotSeries().isEmpty()) { log.warn("No plot data for "+ node.getDisplayName()); continue; } if (!plots.containsKey(testId)) plots.put(testId, new MetricPlotDTOs()); plots.get(testId).getMetricPlotDTOs().add(new MetricPlotDTO(node.getDisplayName(), node.getDisplayName(), groupTitle, makePlot(plotsReal.get(node)))); groupTitle = ""; } } } catch (Exception e) { log.error("Unable to take plot data for {}", metricGroupNode.getDisplayName()); } }
Source:
private ConfigSource createGuessConfig() { ConfigSource configSource = Exec.newConfigSource(); configSource.set("guess_plugins", new ObjectMapper().createArrayNode().add("jira")); configSource.set("guess_sample_buffer_bytes", GUESS_BUFFER_SIZE); return configSource; }

Target:
private ConfigSource createGuessConfig() { return Exec.newConfigSource() .set("guess_plugins", ImmutableList.of("jira")) .set("guess_sample_buffer_bytes", GUESS_BUFFER_SIZE); }
Source:
static ILogData getLogData(CorfuRuntime runtime, boolean loadInCache, long address) { if (loadInCache) { return runtime.getAddressSpaceView().read(address); } else { return runtime.getAddressSpaceView().fetch(address, false); } }

Target:
static ILogData getLogData(CorfuRuntime runtime, boolean loadInCache, long address) { if (loadInCache) { return runtime.getAddressSpaceView().read(address); } else { return runtime.getAddressSpaceView().fetch(address); } }
Source:
public Property[] getProperties(String propertyName) { ArrayList<Property> ret = new ArrayList<>(); for (Property property : m_properties) { if (property.getName().equals(propertyName)) { ret.add(property); } } return ret.toArray(new Property[ret.size()]); }

Target:
public List<Property> getProperties(String propertyName) { List<Property> found = new ArrayList<>(); for (Property property : m_properties) { if (property.getName().equals(propertyName)) { found.add(property); } } return found; }
Source:
public Integer getRefundAmountAvailable() { return refundAmountAvailable; }

Target:
public Optional<Integer> getRefundAmountAvailable() { return Optional.ofNullable(refundAmountAvailable); }
Source:
private void initConnection (Activity activity, long accountId, long providerId) { if (activity == null) return; IImConnection conn = ((ImApp)activity.getApplication()).getConnection(providerId); if (conn == null) { try { conn = ((ImApp)getActivity().getApplication()).createConnection(providerId, accountId); } catch (RemoteException e) { Log.e(ImApp.LOG_TAG,"error creating connection",e); } } if (conn != null) { mFilterView.setConnection(conn); mPresenceView.setConnection(conn); try { mPresenceView.loggingIn(conn.getState() == ImConnection.LOGGING_IN); } catch (RemoteException e) { mPresenceView.loggingIn(false); } Uri.Builder builder = Imps.Contacts.CONTENT_URI_CONTACTS_BY.buildUpon(); ContentUris.appendId(builder, providerId); ContentUris.appendId(builder, accountId); mFilterView.doFilter(builder.build(), null); } }

Target:
private void initConnection (Activity activity, long accountId, long providerId) { IImConnection conn = ((ImApp)activity.getApplication()).getConnection(providerId); if (conn == null) { try { conn = ((ImApp)getActivity().getApplication()).createConnection(providerId, accountId); } catch (RemoteException e) { Log.e(ImApp.LOG_TAG,"error creating connection",e); } } if (conn != null) { mFilterView.setConnection(conn); mPresenceView.setConnection(conn); try { mPresenceView.loggingIn(conn.getState() == ImConnection.LOGGING_IN); } catch (RemoteException e) { mPresenceView.loggingIn(false); } Uri.Builder builder = Imps.Contacts.CONTENT_URI_CONTACTS_BY.buildUpon(); ContentUris.appendId(builder, providerId); ContentUris.appendId(builder, accountId); mFilterView.doFilter(builder.build(), null); } }
Source:
private DbSpace getBdbStats() { return new DbSpace(environment, sorted); }

Target:
private DbSpace getBdbStats() { return new DbSpace(environment); }
Source:
public Loader<Cursor> onCreateLoader(int id, Bundle args) { WhereClause whereClause = new WhereClause.Builder() .where(PublicContract.Truck.OWNED_BY_CURRENT_USER, EQUALS, 1) .build(); String[] projection = TrucksOwnedByUserQuery.PROJECTION; Uri uri = Contract.TRUCK_PROPERTIES_URI; return new CursorLoader(this, uri, projection, whereClause.selection, whereClause.selectionArgs, null); }

Target:
public Loader<Cursor> onCreateLoader(int id, Bundle args) { WhereClause whereClause = new WhereClause.Builder() .where(PublicContract.Truck.OWNED_BY_CURRENT_USER, EQUALS, 1) .build(); String[] projection = TrucksOwnedByUserQuery.PROJECTION; Uri uri = PublicContract.TRUCK_URI; return new CursorLoader(this, uri, projection, whereClause.selection, whereClause.selectionArgs, null); }
Source:
public static int getPeristentExportTrigger(List<String> triggers) { int tableType = 0; Collections.sort(triggers); for (String trigger : triggers) { if(trigger.equals("INSERT")) { tableType += TableType.PERSISTENT_EXPORT_INSERT.get(); } else if(trigger.equals("DELETE")) { tableType += TableType.PERSISTENT_EXPORT_DELETE.get(); } else if(trigger.equals("UPDATE_OLD")) { tableType += TableType.PERSISTENT_EXPORT_UPDATEOLD.get(); } else if(trigger.equals("UPDATE_NEW")) { tableType += TableType.PERSISTENT_EXPORT_UPDATENEW.get(); } else if (trigger.equals("UPDATE")) { tableType += TableType.PERSISTENT_EXPORT_UPDATE.get(); } } return tableType; }

Target:
public static int getPeristentExportTrigger(List<String> triggers) { int tableType = 0; for (String trigger : triggers) { if(trigger.equalsIgnoreCase("INSERT")) { tableType += TableType.PERSISTENT_EXPORT_INSERT.get(); } else if(trigger.equalsIgnoreCase("DELETE")) { tableType += TableType.PERSISTENT_EXPORT_DELETE.get(); } else if(trigger.equalsIgnoreCase("UPDATE_OLD")) { tableType += TableType.PERSISTENT_EXPORT_UPDATEOLD.get(); } else if(trigger.equalsIgnoreCase("UPDATE_NEW")) { tableType += TableType.PERSISTENT_EXPORT_UPDATENEW.get(); } else if (trigger.equalsIgnoreCase("UPDATE")) { tableType += TableType.PERSISTENT_EXPORT_UPDATE.get(); } } return tableType; }
Source:
public void createThumbnail() { String imagePath = filePathInfo.getAbsolutePath(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options); bitmap = ThumbnailUtils.extractThumbnail(bitmap, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT); thumbnail = RoundedBitmapDrawableFactory.create(Resources.getSystem(), bitmap); thumbnail.setCircular(true); }

Target:
public void createThumbnail() { String imagePath = filePathInfo.getAbsolutePath(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = BITMAP_CONFIG; Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options); bitmap = ThumbnailUtils.extractThumbnail(bitmap, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT); thumbnail = RoundedBitmapDrawableFactory.create(Resources.getSystem(), bitmap); thumbnail.setCircular(true); }
Source:
public static void fixNmMdAndUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { final ReferenceSequence refSeq = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())); final byte[] referenceBases = refSeq.getBases(); SequenceUtil.calculateMdAndNmTags(record, referenceBases, true, !isBisulfiteSequence); if (isBisulfiteSequence) { record.setAttribute(SAMTag.NM.name(), SequenceUtil.calculateSamNmTag(record, referenceBases, 0, isBisulfiteSequence)); } fixUq(record, refSeqWalker, isBisulfiteSequence); }

Target:
public static void fixNmMdAndUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { final byte[] referenceBases = refSeqWalker.get(record.getReferenceIndex()).getBases(); SequenceUtil.calculateMdAndNmTags(record, referenceBases, true, !isBisulfiteSequence); if (isBisulfiteSequence) { record.setAttribute(SAMTag.NM.name(), SequenceUtil.calculateSamNmTag(record, referenceBases, 0, isBisulfiteSequence)); } fixUq(record, refSeqWalker, isBisulfiteSequence); }
Source:
protected void verifyToken(JsonNode node, String serviceName, String clientId, String nxuser, String creationDate) { if (node.isArray()) { JsonNode token = null; for (int i = 0; i < node.size(); i++) { if (node.get(i).get("entity-type").textValue().equals(OAUTH2_TOKEN_TYPE) && node.get(i).get("serviceName").textValue().equals(serviceName) && node.get(i).get("nuxeoLogin").textValue().equals(nxuser) && node.get(i).get("creationDate").textValue().equals(creationDate) && (clientId != null ? node.get(i).get("clientId").textValue().equals(clientId) : true)) { token = node.get(i); } } assertNotNull(token); } else { assertEquals(OAUTH2_TOKEN_TYPE, node.get("entity-type").textValue()); assertEquals(serviceName, node.get("serviceName").textValue()); assertEquals(nxuser, node.get("nuxeoLogin").textValue()); assertEquals(creationDate, node.get("creationDate").textValue()); if (clientId != null) { assertEquals(clientId, node.get("clientId").textValue()); } } }

Target:
protected void verifyToken(JsonNode node, String serviceName, String clientId, String nxuser, String creationDate) { if (node.isArray()) { JsonNode token = null; JsonNode child = null; for (int i = 0; i < node.size(); i++) { child = node.get(i); if (child.get("entity-type").textValue().equals(OAUTH2_TOKEN_TYPE) && child.get("serviceName").textValue().equals(serviceName) && child.get("nuxeoLogin").textValue().equals(nxuser) && child.get("creationDate").textValue().equals(creationDate) && (clientId != null ? child.get("clientId").textValue().equals(clientId) : true)) { return; } } fail("No token found."); } else { assertEquals(OAUTH2_TOKEN_TYPE, node.get("entity-type").textValue()); assertEquals(serviceName, node.get("serviceName").textValue()); assertEquals(nxuser, node.get("nuxeoLogin").textValue()); assertEquals(creationDate, node.get("creationDate").textValue()); if (clientId != null) { assertEquals(clientId, node.get("clientId").textValue()); } } }
Source:
public Object visitCast(Cast node, Object context) { Object value = process(node.getExpression(), context); Type type = metadata.getType(parseTypeSignature(node.getType())); if (type.equals(type(node.getExpression())) || node.isTypeOnly()) { return value; } if (value instanceof Expression) { return new Cast((Expression) value, node.getType(), node.isSafe(), node.isTypeOnly()); } if (optimize && !FunctionRegistry.isSupportedLiteralType(type(node))) { return new Cast(toExpression(value, type(node.getExpression())), node.getType(), node.isSafe(), node.isTypeOnly()); } if (value == null) { return null; } if (type == null) { throw new IllegalArgumentException("Unsupported type: " + node.getType()); } Signature operator = metadata.getFunctionRegistry().getCoercion(type(node.getExpression()), type); try { return functionInvoker.invoke(operator, session, ImmutableList.of(value)); } catch (RuntimeException e) { if (node.isSafe()) { return null; } throw e; } }

Target:
public Object visitCast(Cast node, Object context) { Object value = process(node.getExpression(), context); Type targetType = metadata.getType(parseTypeSignature(node.getType())); if (targetType == null) { throw new IllegalArgumentException("Unsupported type: " + node.getType()); } Type sourceType = type(node.getExpression()); if (value instanceof Expression) { if (targetType.equals(sourceType)) { return value; } return new Cast((Expression) value, node.getType(), node.isSafe(), node.isTypeOnly()); } if (node.isTypeOnly()) { return value; } if (optimize && !FunctionRegistry.isSupportedLiteralType(type(node))) { return new Cast(toExpression(value, sourceType), node.getType(), node.isSafe(), node.isTypeOnly()); } if (value == null) { return null; } Signature operator = metadata.getFunctionRegistry().getCoercion(sourceType, targetType); try { return functionInvoker.invoke(operator, session, ImmutableList.of(value)); } catch (RuntimeException e) { if (node.isSafe()) { return null; } throw e; } }
Source:
static Bitmap decodeStream(InputStream stream, Request request) throws IOException { MarkableInputStream markStream = new MarkableInputStream(stream, true); stream = markStream; long mark = markStream.savePosition(65536); final BitmapFactory.Options options = RequestHandler.createBitmapOptions(request); final boolean calculateSize = RequestHandler.requiresInSampleSize(options); boolean isWebPFile = Utils.isWebPFile(stream); boolean isPurgeable = request.purgeable && android.os.Build.VERSION.SDK_INT < 21; markStream.reset(mark); if (isWebPFile || isPurgeable) { byte[] bytes = Utils.toByteArray(stream); if (calculateSize) { BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request); } return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); } else { if (calculateSize) { BitmapFactory.decodeStream(stream, null, options); RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request); markStream.reset(mark); } Bitmap bitmap = BitmapFactory.decodeStream(stream, null, options); if (bitmap == null) { throw new IOException("Failed to decode stream."); } return bitmap; } }

Target:
static Bitmap decodeStream(InputStream stream, Request request) throws IOException { MarkableInputStream markStream = new MarkableInputStream(stream); stream = markStream; markStream.allowMarksToExpire(false); long mark = markStream.savePosition(1024); final BitmapFactory.Options options = RequestHandler.createBitmapOptions(request); final boolean calculateSize = RequestHandler.requiresInSampleSize(options); boolean isWebPFile = Utils.isWebPFile(stream); boolean isPurgeable = request.purgeable && android.os.Build.VERSION.SDK_INT < 21; markStream.reset(mark); if (isWebPFile || isPurgeable) { byte[] bytes = Utils.toByteArray(stream); if (calculateSize) { BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request); } return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); } else { if (calculateSize) { BitmapFactory.decodeStream(stream, null, options); RequestHandler.calculateInSampleSize(request.targetWidth, request.targetHeight, options, request); markStream.reset(mark); } markStream.allowMarksToExpire(true); Bitmap bitmap = BitmapFactory.decodeStream(stream, null, options); if (bitmap == null) { throw new IOException("Failed to decode stream."); } return bitmap; } }
Source:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { if (CompletionStages.isCompletedSuccessfully(delay)) { return asyncValue(delay).thenApply(ctx, command, (rCtx, rCommand, rValue) -> invokeNextThenApply(rCtx, rCommand, applyAndFixVersionForMany)); } return invokeNextThenApply(ctx, command, applyAndFixVersionForMany); }

Target:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { return makeStage(asyncInvokeNext(ctx, command, delay)).thenApply(ctx, command, applyAndFixVersionForMany); }
Source:
void put(SystemStreamPartition ssp, IncomingMessageEnvelope envelope) { List<IncomingMessageEnvelope> messages = bufferedMessages.get(ssp); bufferedMessages.get(ssp).add(envelope); }

Target:
void put(SystemStreamPartition ssp, IncomingMessageEnvelope envelope) { List<IncomingMessageEnvelope> messages = bufferedMessages.get(ssp); String offset = String.valueOf(messages.size()); if (envelope.getOffset().equals(offset)) { throw new SamzaException( String.format("Offset mismatch for ssp %s, expected %s found %s, please set the correct offset", ssp, offset, envelope.getOffset())); } bufferedMessages.get(ssp).add(envelope); }
Source:
public static MassRepairUnitAction performUnitMassRepairOrSalvage(CampaignGUI campaignGUI, Unit unit, boolean isSalvage, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions) { Campaign campaign = campaignGUI.getCampaign(); ArrayList<Person> techs = campaign.getTechs(true); if (techs.isEmpty()) { return new MassRepairUnitAction(unit, isSalvage, MassRepairUnitAction.STATUS.NO_TECHS); } MassRepairUnitAction unitAction = new MassRepairUnitAction(unit, isSalvage, MassRepairUnitAction.STATUS.NO_ACTIONS); for (int i = techs.size() - 1; i >= 0; i--) { Person tech = techs.get(i); if (!tech.canTech(unit.getEntity())) { techs.remove(i); } } Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } boolean performMoreRepairs = true; long time = System.nanoTime(); while (performMoreRepairs) { MassRepairUnitAction currentUnitAction = performUnitMassTechAction(campaignGUI, unit, techs, mroByTypeMap, isSalvage, configuredOptions); performMoreRepairs = currentUnitAction.getPartSet().isHasRepairs(); unitAction.merge(currentUnitAction); if (unitAction.isStatusNoActions()) { unitAction.setStatus(currentUnitAction.getStatus()); } } debugLog("Finished fixing %s in %s ns", unit.getName(), System.nanoTime() - time); return unitAction; }

Target:
public static MassRepairUnitAction performUnitMassRepairOrSalvage(CampaignGUI campaignGUI, Unit unit, boolean isSalvage, List<MassRepairOption> mroList, MassRepairConfiguredOptions configuredOptions) { Campaign campaign = campaignGUI.getCampaign(); List<Person> techs = campaign.getTechs(true); if (techs.isEmpty()) { return new MassRepairUnitAction(unit, isSalvage, MassRepairUnitAction.STATUS.NO_TECHS); } MassRepairUnitAction unitAction = new MassRepairUnitAction(unit, isSalvage, MassRepairUnitAction.STATUS.NO_ACTIONS); for (int i = techs.size() - 1; i >= 0; i--) { Person tech = techs.get(i); if (!tech.canTech(unit.getEntity())) { techs.remove(i); } } Map<Integer, MassRepairOption> mroByTypeMap = new HashMap<Integer, MassRepairOption>(); for (int i = 0; i < mroList.size(); i++) { mroByTypeMap.put(mroList.get(i).getType(), mroList.get(i)); } boolean performMoreRepairs = true; long time = System.nanoTime(); while (performMoreRepairs) { MassRepairUnitAction currentUnitAction = performUnitMassTechAction(campaignGUI, unit, techs, mroByTypeMap, isSalvage, configuredOptions); performMoreRepairs = currentUnitAction.getPartSet().isHasRepairs(); unitAction.merge(currentUnitAction); if (unitAction.isStatusNoActions()) { unitAction.setStatus(currentUnitAction.getStatus()); } } debugLog("Finished fixing %s in %s ns", "performUnitMassRepairOrSalvage", unit.getName(), System.nanoTime() - time); return unitAction; }
Source:
private StringBuffer createBaseQueryBlock(FieldSearchFilter[] filters, boolean selectAll, List<String> categories) { StringBuffer query = super.createBaseQueryBlock(filters, selectAll); for(int i = 0; i < categories.size(); i++) { query.append(String.format("INNER JOIN resourcerelations res%d ON resources.resid = res%d.resid AND res%d.refcategory= ? ", i, i, i)); } return query; }

Target:
private StringBuffer createBaseQueryBlock(FieldSearchFilter[] filters, boolean selectAll, List<String> categories) { StringBuffer query = super.createBaseQueryBlock(filters, selectAll); if (categories != null) { for (int i = 0; i < categories.size(); i++) { query.append(String.format( "INNER JOIN resourcerelations res%d ON resources.resid = res%d.resid AND res%d.refcategory= ? ", i, i, i)); } } return query; }
Source:
public NetworkScan requestNetworkScan(int subId, NetworkScanRequest request, Executor executor, NetworkScanCallback callback, String callingPackage) { try { ITelephony telephony = getITelephony(); if (telephony != null) { int scanId; synchronized (mScanInfo) { scanId = telephony.requestNetworkScan( subId, request, mMessenger, new Binder(), callingPackage); if (scanId == INVALID_SCAN_ID) { Rlog.e(TAG, "Failed to initiate network scan"); return null; } saveScanInfo(scanId, request, executor, callback); } return new NetworkScan(scanId, subId); } } catch (RemoteException ex) { Rlog.e(TAG, "requestNetworkScan RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "requestNetworkScan NPE", ex); } return null; }

Target:
public NetworkScan requestNetworkScan(int subId, NetworkScanRequest request, Executor executor, NetworkScanCallback callback, String callingPackage) { try { ITelephony telephony = getITelephony(); if (telephony != null) { int scanId; synchronized (mScanInfo) { scanId = telephony.requestNetworkScan( subId, request, mMessenger, new Binder(), callingPackage); if (scanId == INVALID_SCAN_ID) { Rlog.e(TAG, "Failed to initiate network scan"); return null; } saveScanInfo(scanId, request, executor, callback); return new NetworkScan(scanId, subId); } } } catch (RemoteException ex) { Rlog.e(TAG, "requestNetworkScan RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "requestNetworkScan NPE", ex); } return null; }
Source:
final synchronized private SecretKey getSecretKeyFromAndroidKeyStore() throws IOException, GeneralSecurityException { if (sSecretKeyFromAndroidKeyStore != null) { return sSecretKeyFromAndroidKeyStore; } File keyFile = new File(mContext.getDir(mContext.getPackageName(), Context.MODE_PRIVATE), ADALKS); if (mKeyPair == null) { mKeyPair = getKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Retrived keypair from androidKeyStore"); } Cipher wrapCipher = Cipher.getInstance(WRAP_ALGORITHM); if (!keyFile.exists()) { Logger.v(TAG, "Key file does not exists"); final SecretKey key = generateSecretKey(); Logger.v(TAG, "Wrapping SecretKey"); final byte[] keyWrapped = wrap(wrapCipher, key); Logger.v(TAG, "Writing SecretKey"); writeKeyData(keyFile, keyWrapped); Logger.v(TAG, "Finished writing SecretKey"); } Logger.v(TAG, "Reading SecretKey"); try { final byte[] encryptedKey = readKeyData(keyFile); sSecretKeyFromAndroidKeyStore = unwrap(wrapCipher, encryptedKey); Logger.v(TAG, "Finished reading SecretKey"); } catch (GeneralSecurityException ex) { Logger.e(TAG, "Unwrap failed for AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED); mKeyPair = null; sSecretKeyFromAndroidKeyStore = null; deleteKeyFile(); resetKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Removed previous key pair info."); } return sSecretKeyFromAndroidKeyStore; }

Target:
final synchronized private SecretKey getSecretKeyFromAndroidKeyStore() throws IOException, GeneralSecurityException { if (sSecretKeyFromAndroidKeyStore != null) { return sSecretKeyFromAndroidKeyStore; } File keyFile = new File(mContext.getDir(mContext.getPackageName(), Context.MODE_PRIVATE), ADALKS); if (mKeyPair == null) { mKeyPair = getKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Retrived keypair from androidKeyStore"); } Cipher wrapCipher = Cipher.getInstance(WRAP_ALGORITHM); if (!keyFile.exists()) { Logger.v(TAG, "Key file does not exists"); final SecretKey key = generateSecretKey(); Logger.v(TAG, "Wrapping SecretKey"); final byte[] keyWrapped = wrap(wrapCipher, key); Logger.v(TAG, "Writing SecretKey"); writeKeyData(keyFile, keyWrapped); Logger.v(TAG, "Finished writing SecretKey"); } Logger.v(TAG, "Reading SecretKey"); try { final byte[] encryptedKey = readKeyData(keyFile); sSecretKeyFromAndroidKeyStore = unwrap(wrapCipher, encryptedKey); Logger.v(TAG, "Finished reading SecretKey"); } catch (GeneralSecurityException | IOException ex) { Logger.e(TAG, "Unwrap failed for AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, ex); mKeyPair = null; sSecretKeyFromAndroidKeyStore = null; deleteKeyFile(); resetKeyPairFromAndroidKeyStore(); Logger.v(TAG, "Removed previous key pair info."); } return sSecretKeyFromAndroidKeyStore; }
Source:
public void storeData(String data, String filepath) throws AREAsapiException { this.storeData(data, filepath, RES_TYPE.DATA, Charsets.UTF_8); }

Target:
public void storeData(String data, String filepath) throws AREAsapiException { this.storeData(data, filepath, RES_TYPE.DATA); }
Source:
public HCatClient getHCatClient() { if (null == this.hCatClient) { try { this.hCatClient = HCatUtil.getHCatClient(hcatEndpoint); } catch (HCatException e) { throw new TestNGException(e); } } return this.hCatClient; }

Target:
public HCatClient getHCatClient() { if (null == this.hCatClient) { try { this.hCatClient = HCatUtil.getHCatClient(hcatEndpoint); } catch (HCatException e) { Assert.fail("Unable to create hCatClient because of exception:\n" + ExceptionUtils.getStackTrace(e)); } } return this.hCatClient; }
Source:
public void startExport(Process process, OutputStream os, String xslt) throws IOException { try { Document doc = createDocument(process, true); XMLOutputter outp = new XMLOutputter(); outp.setFormat(Format.getPrettyFormat()); outp.output(doc, os); os.close(); } catch (IOException | RuntimeException e) { throw new IOException(e.getMessage(), e); } }

Target:
public void startExport(Process process, OutputStream os, String xslt) throws IOException { try { Document doc = createDocument(process, true); XMLOutputter outp = new XMLOutputter(); outp.setFormat(Format.getPrettyFormat()); outp.output(doc, os); os.close(); } catch (RuntimeException e) { throw new IOException(e.getMessage(), e); } }
Source:
public void channelActive(final ChannelHandlerContext ctx) throws Exception { log.trace("channelActive: Incoming connection established from: Start Read Timeout.", ctx.channel().remoteAddress()); ctx.pipeline().addBefore(ctx.name(), READ_TIMEOUT_HANDLER, new ReadTimeoutHandler(this.timeoutInSeconds)); }

Target:
public void channelActive(final ChannelHandlerContext ctx) throws Exception { log.info("channelActive: Incoming connection established from: Start Read Timeout.", ctx.channel().remoteAddress()); ctx.pipeline().addBefore(ctx.name(), READ_TIMEOUT_HANDLER, new ReadTimeoutHandler(this.timeoutInSeconds)); }