auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override @NonNull public View getView(int position, View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.item_page_list_entry, null); holder = new ViewHolder(); holder.icon = (SimpleDraweeView) convertView.findViewById(R.id.page_list_item_image); holder.title = (TextView) convertView.findViewById(R.id.page_list_item_title); holder.description = (GoneIfEmptyTextView) convertView.findViewById(R.id.page_list_item_description); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final DisambigResult item = items[position]; holder.title.setText(item.getTitle().getDisplayText()); holder.description.setText(item.getTitle().getDescription()); ViewUtil.loadImageUrlInto(holder.icon, pageImagesCache.get(item.getTitle().getPrefixedText())); return convertView; }

Target:
@Override @NonNull public View getView(int position, View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.item_page_list_entry, null); holder = new ViewHolder(); holder.icon = (SimpleDraweeView) convertView.findViewById(R.id.page_list_item_image); holder.title = (TextView) convertView.findViewById(R.id.page_list_item_title); holder.description = (GoneIfEmptyTextView) convertView.findViewById(R.id.page_list_item_description); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final DisambigResult item = items[position]; holder.title.setText(item.getTitle().getDisplayText()); holder.description.setText(item.getTitle().getDescription()); ViewUtil.loadImageUrlInto(holder.icon, pageImagesCache.get(item.getTitle().getPrefixedText())); return convertView; }
Source:
private static boolean isImagesExists(Iterable<DiskImage> images, Guid storagePoolId, Guid domainId, RefObject<ArrayList<DiskImage>> irsImages) { irsImages.argvalue = new ArrayList<DiskImage>(); boolean returnValue = true; for (DiskImage image : images) { Guid storageDomainId = !Guid.Empty.equals(domainId) ? domainId : image.getstorage_ids().get(0); DiskImage fromIrs = isImageExist(storagePoolId, storageDomainId, image); if (fromIrs == null) { returnValue = false; } else { irsImages.argvalue.add(fromIrs); } } return returnValue; }

Target:
private static boolean isImagesExists(Iterable<DiskImage> images, Guid storagePoolId, Guid domainId, RefObject<ArrayList<DiskImage>> irsImages) { irsImages.argvalue = new ArrayList<DiskImage>(); boolean returnValue = true; for (DiskImage image : images) { Guid storageDomainId = !Guid.Empty.equals(domainId) ? domainId : image.getstorage_ids().get(0); DiskImage fromIrs = isImageExist(storagePoolId, storageDomainId, image); if (fromIrs == null) { returnValue = false; break; } else { irsImages.argvalue.add(fromIrs); } } return returnValue; }
Source:
public void getUrl() { String actual = influxDBContainer.getUrl(); assertThat(actual, startsWith("http://localhost:")); }

Target:
public void getUrl() { String actual = influxDBContainer.getUrl(); assertThat(actual, notNullValue()); }
Source:
private CompressedIntBufferObjectStrategy(final ByteOrder order, final CompressionStrategy compression, final int sizePer) { super( order, new BufferConverter<IntBuffer>() { @Override public IntBuffer convert(ByteBuffer buf) { return buf.asIntBuffer(); } @Override public int compare(IntBuffer lhs, IntBuffer rhs) { return Ordering.natural().nullsFirst().compare(lhs, rhs); } @Override public int sizeOf(int count) { return count * Ints.BYTES; } @Override public IntBuffer combine(ByteBuffer into, IntBuffer from) { return into.asIntBuffer().put(from); } }, compression, sizePer ); }

Target:
private CompressedIntBufferObjectStrategy(final ByteOrder order, final CompressionStrategy compression, final int sizePer) { super( order, new BufferConverter<IntBuffer>() { @Override public IntBuffer convert(ByteBuffer buf) { return buf.asIntBuffer(); } @Override public int compare(IntBuffer lhs, IntBuffer rhs) { return ORDERING.compare(lhs, rhs); } @Override public int sizeOf(int count) { return count * Ints.BYTES; } @Override public IntBuffer combine(ByteBuffer into, IntBuffer from) { return into.asIntBuffer().put(from); } }, compression, sizePer ); }
Source:
static ConfigSelector.Builder configSelectorBuilder() { return ConfigSelector.builderOfScope("td") .addSecretOnlyAccess("apikey") .addSecretSharedAccess("use_ssl", "proxy.enabled", "proxy.host", "proxy.port", "proxy.user", "proxy.password", "proxy.use_ssl", "endpoint", "host", "port", "user", "database"); }

Target:
static ConfigSelector.Builder configSelectorBuilder() { return ConfigSelector.builderOfScope("td") .addSecretAccess("use_ssl", "proxy.enabled", "proxy.host", "proxy.port", "proxy.user", "proxy.password", "proxy.use_ssl", "endpoint", "host", "port", "user", "database") .addSecretOnlyAccess("apikey") ; }
Source:
@Override public void printUsage(Logger log) { if (!experimentalEnabled()) return; usage(log, "Print metadata command help:", METADATA, HELP.toString() ); usage(log, "Print list of binary metadata types:", METADATA, LIST.toString() ); usage(log, "Print detailed info about specified binary type " + "(the type must be specified by type name or by type identifier):", METADATA, DETAILS.toString(), optional(MetadataTypeArgs.OPT_TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.OPT_TYPE_NAME, "<typeName>") ); usage(log, "Remove the metadata of the specified type " + "(the type must be specified by type name or by type identifier) from cluster and saves the removed " + "metadata to the specified file. \n" + "If the file name isn't specified the output file name is: '<typeId>.bin'", METADATA, REMOVE.toString(), optional(MetadataTypeArgs.OPT_TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.OPT_TYPE_NAME, "<typeName>"), optional(MetadataRemoveCommand.OPT_OUT_FILE_NAME, "<fileName>") ); usage(log, "Update cluster metadata from specified file (file name is required)", METADATA, UPDATE.toString(), MetadataUpdateCommand.OPT_IN_FILE_NAME, "<fileName>" ); }

Target:
@Override public void printUsage(Logger log) { if (!experimentalEnabled()) return; usage(log, "Print metadata command help:", METADATA, HELP.toString() ); usage(log, "Print list of binary metadata types:", METADATA, LIST.toString() ); usage(log, "Print detailed info about specified binary type " + "(the type must be specified by type name or by type identifier):", METADATA, DETAILS.toString(), optional(MetadataTypeArgs.TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.TYPE_NAME, "<typeName>") ); usage(log, "Remove the metadata of the specified type " + "(the type must be specified by type name or by type identifier) from cluster and saves the removed " + "metadata to the specified file. \n" + "If the file name isn't specified the output file name is: '<typeId>.bin'", METADATA, REMOVE.toString(), optional(MetadataTypeArgs.TYPE_ID, "<typeId>"), optional(MetadataTypeArgs.TYPE_NAME, "<typeName>"), optional(MetadataRemoveCommand.OUT_FILE_NAME, "<fileName>") ); usage(log, "Update cluster metadata from specified file (file name is required)", METADATA, UPDATE.toString(), MetadataUpdateCommand.IN_FILE_NAME, "<fileName>" ); }
Source:
public YieldExpressionTree yieldFromExpression(InternalSyntaxToken yieldToken, InternalSyntaxToken fromToken, ExpressionTree expr) { return "from".equals(fromToken.text()) ? new YieldExpressionTreeImpl(yieldToken, fromToken, expr) : null; }

Target:
public YieldExpressionTree yieldFromExpression(InternalSyntaxToken yieldToken, InternalSyntaxToken fromToken, ExpressionTree expr) { return new YieldExpressionTreeImpl(yieldToken, fromToken, expr); }
Source:
private void finishAndShowSignInScreen() { if (!isAdded()) { return; } endProgress(); if (AppPrefs.isLoginWizardStyleActivated()) { if (mLoginListener != null) { mLoginListener.newUserCreatedButErrored(getEmail(), getPassword()); } } else { Intent intent = new Intent(); intent.putExtra("username", getUsername()); intent.putExtra("password", getPassword()); getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, intent); try { getFragmentManager().popBackStack(); } catch (IllegalStateException e) { AppLog.e(T.NUX, e); } } ToastUtils.showToast(getActivity(), R.string.signup_succeed_signin_failed, Duration.LONG); }

Target:
private void finishAndShowSignInScreen() { if (!isAdded()) { return; } if (AppPrefs.isLoginWizardStyleActivated()) { if (mLoginListener != null) { mLoginListener.newUserCreatedButErrored(getEmail(), getPassword()); } } else { Intent intent = new Intent(); intent.putExtra("username", getUsername()); intent.putExtra("password", getPassword()); getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, intent); try { getFragmentManager().popBackStack(); } catch (IllegalStateException e) { AppLog.e(T.NUX, e); } } ToastUtils.showToast(getActivity(), R.string.signup_succeed_signin_failed, Duration.LONG); }
Source:
public void listKeySnippets() { KeyClient keyClient = createClient(); for (KeyBase key : keyClient.listKeys()) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys for (KeyBase key : keyClient.listKeys(new Context(key2, value2))) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys#Context keyClient.listKeys().iterableByPage().forEach(resp -> { System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.headers(), resp.request().url(), resp.statusCode()); resp.items().forEach(value -> { Key keyWithMaterial = keyClient.getKey(value); System.out.printf("Received key with name %s and type %s %n", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); }); }); END: com.azure.keyvault.keys.keyclient.listKeys.iterableByPage }

Target:
public void listKeySnippets() { KeyClient keyClient = createClient(); for (KeyBase key : keyClient.listKeys()) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys for (KeyBase key : keyClient.listKeys(new Context(key2, value2))) { Key keyWithMaterial = keyClient.getKey(key); System.out.printf("Received key with name %s and type %s", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); } END: com.azure.keyvault.keys.keyclient.listKeys#Context keyClient.listKeys().iterableByPage().forEach(resp -> { System.out.printf("Got response headers . Url: %s, Status code: %d %n", resp.request().url(), resp.statusCode()); resp.items().forEach(value -> { Key keyWithMaterial = keyClient.getKey(value); System.out.printf("Received key with name %s and type %s %n", keyWithMaterial.name(), keyWithMaterial.keyMaterial().kty()); }); }); END: com.azure.keyvault.keys.keyclient.listKeys.iterableByPage }
Source:
public List<Folder> getContentFolders() { return typeGenerateImages ? process.getProject().getFolders().parallelStream() .filter(folder -> folder.getDerivative().isPresent() || folder.getDpi().isPresent() || folder.getImageScale().isPresent() || folder.getImageSize().isPresent()) .collect(Collectors.toList()) : Collections.emptyList(); }

Target:
public List<Folder> getContentFolders() { List<Folder> contentFolders = typeGenerateImages ? process.getProject().getFolders().parallelStream() .filter(folder -> folder.getDerivative().isPresent() || folder.getDpi().isPresent() || folder.getImageScale().isPresent() || folder.getImageSize().isPresent()) .collect(Collectors.toList()) : Collections.emptyList(); return contentFolders; }
Source:
public Text (Composite parent, int style) { super (parent, checkStyle (style)); if ((style & SWT.SEARCH) != 0) { if ((style & SWT.ICON_CANCEL) != 0) { this.style |= SWT.ICON_CANCEL; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_CLEAR); OS.gtk_entry_set_icon_sensitive (handle, OS.GTK_ENTRY_ICON_SECONDARY, false); } if ((style & SWT.ICON_SEARCH) != 0) { this.style |= SWT.ICON_SEARCH; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_FIND); } } }

Target:
public Text (Composite parent, int style) { super (parent, checkStyle (style)); if ((style & SWT.SEARCH) != 0) { if ((style & SWT.ICON_CANCEL) != 0) { this.style |= SWT.ICON_CANCEL; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_SECONDARY, OS.GTK_NAMED_ICON_CLEAR); OS.gtk_entry_set_icon_sensitive (handle, OS.GTK_ENTRY_ICON_SECONDARY, false); } if ((style & SWT.ICON_SEARCH) != 0) { this.style |= SWT.ICON_SEARCH; OS.gtk_entry_set_icon_from_icon_name (handle, OS.GTK_ENTRY_ICON_PRIMARY, OS.GTK_NAMED_ICON_FIND); } } }
Source:
public void testZipFileName() { String path = "github.com-dockstore-hello_world"; String versionName = "master"; Assert.assertEquals("github.com-dockstore-hello_world-master.zip", EntryVersionHelper.generateZipFileName(path, versionName)); }

Target:
public void testZipFileName() { String path = "github.com/dockstore/hello_world"; String versionName = "master"; Assert.assertEquals("github.com-dockstore-hello_world-master.zip", EntryVersionHelper.generateZipFileName(path, versionName)); }
Source:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { ExchangeNode exchangeNode = (ExchangeNode) node; Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, exchangeNode.getInputs().get(i), exchangeNode.getOutputSymbols()); if (estimate.isPresent()) { estimate = Optional.of(addStatsAndSumDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } verify(estimate.isPresent()); return estimate; }

Target:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { ExchangeNode exchangeNode = (ExchangeNode) node; Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, exchangeNode.getInputs().get(i), exchangeNode.getOutputSymbols()); if (estimate.isPresent()) { estimate = Optional.of(addStatsAndMaxDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } verify(estimate.isPresent()); return estimate; }
Source:
public HistoryScanHolder(final View itemView, final String productUrl, Activity activity) { super(itemView); txtTitle = itemView.findViewById(R.id.titleHistory); txtBarcode = itemView.findViewById(R.id.barcodeHistory); txtProductDetails = itemView.findViewById(R.id.productDetailsHistory); imgProduct = itemView.findViewById(R.id.imgHistoryProduct); imgNutritionGrade = itemView.findViewById(R.id.nutritionGradeImage); txtDate = itemView.findViewById(R.id.dateView); mActivity = activity; historyImageProgressbar = itemView.findViewById(R.id.historyImageProgressbar); itemView.setOnClickListener(v -> { ConnectivityManager cm = (ConnectivityManager) v.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); if (isConnected) { OpenFoodAPIClient api = new OpenFoodAPIClient(mActivity); api.getProduct(txtBarcode.getText().toString(), (Activity) v.getContext()); } else { Toast.makeText(mActivity, "Sorry! There was a network error! Please check your internet connection", Toast.LENGTH_SHORT).show(); } }); }

Target:
public HistoryScanHolder(final View itemView, final String productUrl, Activity activity) { super(itemView); txtTitle = itemView.findViewById(R.id.titleHistory); txtBarcode = itemView.findViewById(R.id.barcodeHistory); txtProductDetails = itemView.findViewById(R.id.productDetailsHistory); imgProduct = itemView.findViewById(R.id.imgHistoryProduct); imgNutritionGrade = itemView.findViewById(R.id.nutritionGradeImage); txtDate = itemView.findViewById(R.id.dateView); mActivity = activity; historyImageProgressbar = itemView.findViewById(R.id.historyImageProgressbar); itemView.setOnClickListener(v -> { ConnectivityManager cm = (ConnectivityManager) v.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting(); if (isConnected) { OpenFoodAPIClient api = new OpenFoodAPIClient(mActivity); api.getProduct(txtBarcode.getText().toString(), (Activity) v.getContext()); } else { Toast.makeText(mActivity, R.string.history_network_error, Toast.LENGTH_SHORT).show(); } }); }
Source:
public void setUp() throws Exception { denseThenSparseStrategy = new DenseThenSparseStrategy(); denseThenSparseStrategy.setNetworkParameters(UnitTestParams.get()); BlockStore blockStore = new MemoryBlockStore(UnitTestParams.get()); Wallet wallet = new Wallet(UnitTestParams.get()); blockChain = new BlockChain(UnitTestParams.get(), wallet,blockStore); Block b1 = createFakeBlock(blockStore, Block.BLOCK_HEIGHT_GENESIS).block; blockChain.add(b1); for (int i=blockChain.getBestChainHeight() + 1; i<100; i++) { try { Block b = createFakeBlock(blockStore, i).block; blockChain.add(b); } catch (Exception e) { log.error("fails at i {}", i, e); break; } } }

Target:
public void setUp() throws Exception { NetworkParameters params = MainNetParams.get(); Context context = new Context(params); URL resource = this.getClass().getResource("/org/bitcoinj/core/first-100k-blocks.dat"); File blockFile = new File(resource.toURI()); loader = new BlockFileLoader(params, Arrays.asList(blockFile)); FullPrunedBlockStore blockStore = new MemoryFullPrunedBlockStore(params, 100); blockChain = new FullPrunedBlockChain(context, blockStore); denseThenSparseStrategy = new DenseThenSparseStrategy(); denseThenSparseStrategy.setNetworkParameters(params); }
Source:
private Response load() throws IOException { if (this.saved.get() == null) { Iterable<String> head; InputStream body; try { head = this.origin.head(); body = this.origin.body(); } catch (final RsForward ex) { head = ex.head(); body = ex.body(); } this.saved.compareAndSet(null, new RsSimple(head, body)); } return this.saved.get(); }

Target:
private Response load() throws IOException { synchronized (this.saved) { if (this.saved.isEmpty()) { Iterable<String> head; InputStream body; try { head = this.origin.head(); body = this.origin.body(); } catch (final RsForward ex) { head = ex.head(); body = ex.body(); } this.saved.add(new RsSimple(head, body)); } } return this.saved.get(0); }
Source:
public void testMarkerColor() { RGBAColor rgbaColor; RGBA rgbaColorToCompare; for (int i = 0; i < TEST_COLORS.length; i++) { TraceMarker traceMarker = new TraceMarker("Marker" + String.valueOf(i), null, fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), TEST_COLORS[i]); rgbaColor = new RGBAColor(Integer.parseInt(X11ColorUtils.toHexColor(TEST_COLORS[i]).substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } TraceMarker traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), ""); rgbaColor = new RGBAColor(Integer.parseInt(X11ColorUtils.toHexColor(DEFAULT_COLOR).substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), "invalid"); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), null); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); }

Target:
public void testMarkerColor() { RGBAColor rgbaColor; RGBA rgbaColorToCompare; String[] testColors = X11TestColors.getColors(); for (int i = 0; i < testColors.length; i++) { TraceMarker traceMarker = new TraceMarker("Marker" + String.valueOf(i), null, fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), testColors[i]); String hexColor = X11ColorUtils.toHexColor(testColors[i]); if (hexColor != null) { rgbaColor = new RGBAColor(Integer.parseInt(hexColor.substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } else { fail(X11_COLOR_ERROR_MESSAGE); } } TraceMarker traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), ""); String hexColor = X11ColorUtils.toHexColor(DEFAULT_COLOR); if (hexColor != null) { rgbaColor = new RGBAColor(Integer.parseInt(hexColor.substring(1), 16)); rgbaColorToCompare = new RGBA(rgbaColor.getRed(), rgbaColor.getGreen(), rgbaColor.getBlue(), ALPHA); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), "invalid"); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); traceMarker = new TraceMarker("", "", fTrace.getStartTime().toNanos(), fTrace.getEndTime().toNanos(), null); assertTrue(traceMarker.getRGBAColor().equals(rgbaColorToCompare)); } else { fail(X11_COLOR_ERROR_MESSAGE); } }
Source:
public FetchedDataChunk(ByteBufferMessageSet messages, PartitionTopicInfo topicInfo, long fetchOffset) { super(); this.messages = messages; this.topicInfo = topicInfo; this.fetchOffset = fetchOffset; }

Target:
public FetchedDataChunk(ByteBufferMessageSet messages, PartitionTopicInfo topicInfo, long fetchOffset) { this.messages = messages; this.topicInfo = topicInfo; this.fetchOffset = fetchOffset; }
Source:
public Optional<StudyEntryPropertyData> getStudyEntryPropertyData(final int studyEntryPropertyId) { final StockProperty stockProperty = this.daoFactory.getStockPropertyDao().getById(studyEntryPropertyId); if (stockProperty != null) { final StudyEntryPropertyData studyEntryPropertyData = new StudyEntryPropertyData(); studyEntryPropertyData.setVariableId(stockProperty.getTypeId()); studyEntryPropertyData.setStudyEntryPropertyId(stockProperty.getStockPropId()); studyEntryPropertyData.setValue(stockProperty.getValue()); return Optional.of(studyEntryPropertyData); } return Optional.empty(); }

Target:
public Optional<StudyEntryPropertyData> getStudyEntryPropertyData(final int studyEntryPropertyId) { final StockProperty stockProperty = this.daoFactory.getStockPropertyDao().getById(studyEntryPropertyId); if (stockProperty != null) { return Optional .of(new StudyEntryPropertyData(stockProperty.getStockPropId(), stockProperty.getTypeId(), stockProperty.getValue())); } return Optional.empty(); }
Source:
private int getIndex(int seqNum, boolean updateRoc) { if (highestSeqNumReceived == -1) { if (updateRoc) { highestSeqNumReceived = seqNum; } return seqNum; } int v; if (rolledOverTo(seqNum, highestSeqNumReceived)) { v = roc - 1; } else if (rolledOverTo(highestSeqNumReceived, seqNum)) { v = roc + 1; if (updateRoc) roc = v; } else { v = roc; } if (updateRoc && isNewerThan(seqNum, highestSeqNumReceived)) { highestSeqNumReceived = seqNum; } return 0x8000 * v + seqNum; }

Target:
private int getIndex(int seqNum, boolean updateRoc) { if (highestSeqNumReceived == -1) { if (updateRoc) { highestSeqNumReceived = seqNum; } return seqNum; } int delta = Vp8Utils.getExtendedPictureIdDelta(seqNum, highestSeqNumReceived); int v; if (delta < 0 && highestSeqNumReceived < seqNum) { v = roc - 1; } else if (delta > 0 && seqNum < highestSeqNumReceived) { v = roc + 1; if (updateRoc) roc = v; } else { v = roc; } if (updateRoc && delta > 0) { highestSeqNumReceived = seqNum; } return 0x8000 * v + seqNum; }
Source:
default boolean collisionExtendsVertically(BlockState state, IBlockReader world, BlockPos pos, Entity collidingEntity) { return false; }

Target:
default boolean collisionExtendsVertically(BlockState state, IBlockReader world, BlockPos pos, Entity collidingEntity) { return getBlock().isIn(BlockTags.FENCES) || getBlock().isIn(BlockTags.WALLS) || getBlock() instanceof FenceGateBlock; }
Source:
private void doAddBundle() { try { Workspace workspace = model.getWorkspace(); RepoBundleSelectionWizard wizard = new RepoBundleSelectionWizard(workspace, new ArrayList<VersionedClause>(), DependencyPhase.Run); wizard.setSelectionPageTitle("Add Bundle Requirement"); WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard); if (Window.OK == dialog.open()) { final List<VersionedClause> result = wizard.getSelectedBundles(); final List<Requirement> adding = new ArrayList<Requirement>(result.size()); for (VersionedClause bundle : result) { Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, bundle.getName()); String versionRange = bundle.getVersionRange(); if (versionRange != null && !"latest".equals(versionRange)) { filter = new AndFilter().addChild(filter).addChild(new LiteralFilter(Filters.fromVersionRange(versionRange))); } Requirement req = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement(); adding.add(req); } addRequirementWithCheckForExisting(adding); } } catch (Exception e) { ErrorDialog.openError(getSection().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error selecting bundles.", e)); } }

Target:
private void doAddBundle() { try { Workspace workspace = model.getWorkspace(); RepoBundleSelectionWizard wizard = new RepoBundleSelectionWizard(workspace, new ArrayList<VersionedClause>(), DependencyPhase.Run); wizard.setSelectionPageTitle("Add Bundle Requirement"); WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard); if (Window.OK == dialog.open()) { final List<VersionedClause> result = wizard.getSelectedBundles(); final Set<Requirement> adding = new HashSet<Requirement>(result.size()); for (VersionedClause bundle : result) { Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, bundle.getName()); String versionRange = bundle.getVersionRange(); if (versionRange != null && !"latest".equals(versionRange)) { filter = new AndFilter().addChild(filter).addChild(new LiteralFilter(Filters.fromVersionRange(versionRange))); } Requirement req = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement(); adding.add(req); } if (!adding.isEmpty()) { updateViewerWithNewRequirements(adding); } } } catch (Exception e) { ErrorDialog.openError(getSection().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error selecting bundles.", e)); } }
Source:
public void writeBasedOnFeaturePath(final Path featurePath) throws IOException { if (!Files.isRegularFile(featurePath)) return; write(Tribble.tabixIndexPath(featurePath)); }

Target:
public void writeBasedOnFeaturePath(final Path featurePath) throws IOException { if (!Files.isRegularFile(featurePath)) { LOGGER.warn("Index not written into ", featurePath); return; } write(Tribble.tabixIndexPath(featurePath)); }
Source:
public ResponseEntity<FileSystemResource> getImportGermplasmExcelTemplate(@PathVariable final String cropName, @RequestParam(required = false) final String programUUID) { final VariableFilter variableFilter = new VariableFilter(); variableFilter.addPropertyId(TermId.INVENTORY_AMOUNT_PROPERTY.getId()); final List<VariableDetails> units = this.variableService.getVariablesByFilter(variableFilter); final List<LocationDto> storageLocation = this.locationService.getLocations(cropName, programUUID, GermplasmResource.STORAGE_LOCATION_TYPE, null, null, false); final List<LocationDto> locations = this.locationService.getLocations(cropName, programUUID, GermplasmResource.LOCATION_TYPE, null, null, false); final List<org.generationcp.middleware.api.brapi.v1.attribute.AttributeDTO> attributeDTOS = this.germplasmService.getGermplasmAttributes(); final List<Method> breedingMethods = this.germplasmService.getAllBreedingMethods(); final List<GermplasmName> germplasmNames = this.germplasmService.getGermplasmNames(); final File file = this.germplasmTemplateExportService.export(breedingMethods, germplasmNames, attributeDTOS, locations, storageLocation, units); final HttpHeaders headers = new HttpHeaders(); headers .add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s", FileUtils.sanitizeFileName(file.getName()))); final FileSystemResource fileSystemResource = new FileSystemResource(file); return new ResponseEntity<>(fileSystemResource, headers, HttpStatus.OK); }

Target:
public ResponseEntity<FileSystemResource> getImportGermplasmExcelTemplate(@PathVariable final String cropName, @RequestParam(required = false) final String programUUID) { final File file = this.germplasmTemplateExportService.export(cropName, programUUID); final HttpHeaders headers = new HttpHeaders(); headers .add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s", FileUtils.sanitizeFileName(file.getName()))); final FileSystemResource fileSystemResource = new FileSystemResource(file); return new ResponseEntity<>(fileSystemResource, headers, HttpStatus.OK); }
Source:
public long getMaxResultWindow() { if (maxResultWindow == null) { ConfigurationService cs = Framework.getService(ConfigurationService.class); String maxResultWindowStr = cs.getProperty(ES_MAX_RESULT_WINDOW_PROPERTY, DEFAULT_ES_MAX_RESULT_WINDOW_VALUE); try { maxResultWindow = Long.valueOf(maxResultWindowStr); } catch (NumberFormatException e) { log.warn(String.format( "Invalid maxResultWindow property value: %s for page provider: %s, fallback to default.", maxResultWindow, getName())); maxResultWindow = Long.valueOf(DEFAULT_ES_MAX_RESULT_WINDOW_VALUE); } } return maxResultWindow; }

Target:
public long getMaxResultWindow() { if (maxResultWindow == null) { ConfigurationService cs = Framework.getService(ConfigurationService.class); String maxResultWindowStr = cs.getProperty(ES_MAX_RESULT_WINDOW_PROPERTY, DEFAULT_ES_MAX_RESULT_WINDOW_VALUE); try { maxResultWindow = Long.valueOf(maxResultWindowStr); } catch (NumberFormatException e) { log.warn(String.format( "Invalid maxResultWindow property value: %s for page provider: %s, fallback to default.", maxResultWindowStr, getName())); maxResultWindow = Long.valueOf(DEFAULT_ES_MAX_RESULT_WINDOW_VALUE); } } return maxResultWindow; }
Source:
public StaticHostProvider(Collection<InetSocketAddress> serverAddresses) throws UnknownHostException { for (InetSocketAddress address : serverAddresses) { InetAddress resolvedAddresses[]; try { Method m = InetSocketAddress.class.getDeclaredMethod("getHostString"); m.setAccessible(true); resolvedAddresses = InetAddress.getAllByName((String) m.invoke(address)); } catch (IllegalAccessException e) { resolvedAddresses = InetAddress.getAllByName(getHostString(address)); } catch (NoSuchMethodException e) { resolvedAddresses = InetAddress.getAllByName(getHostString(address)); } catch (InvocationTargetException e) { resolvedAddresses = InetAddress.getAllByName(getHostString(address)); } for (InetAddress resolvedAddress : resolvedAddresses) { this.serverAddresses.add(new InetSocketAddress(resolvedAddress, address.getPort())); } } if (this.serverAddresses.isEmpty()) { throw new IllegalArgumentException( "A HostProvider may not be empty!"); } Collections.shuffle(this.serverAddresses); }

Target:
public StaticHostProvider(Collection<InetSocketAddress> serverAddresses) throws UnknownHostException { for (InetSocketAddress address : serverAddresses) { InetAddress resolvedAddresses[] = InetAddress.getAllByName(getHostString(address)); for (InetAddress resolvedAddress : resolvedAddresses) { this.serverAddresses.add(new InetSocketAddress(resolvedAddress, address.getPort())); } } if (this.serverAddresses.isEmpty()) { throw new IllegalArgumentException( "A HostProvider may not be empty!"); } Collections.shuffle(this.serverAddresses); }
Source:
public void normalize(CertifiedProductSearchDetails listing) { if (listing.getSed() != null && listing.getSed().getTestTasks() != null && listing.getSed().getTestTasks().size() > 0) { listing.getSed().getTestTasks().stream() .forEach(testTask -> { lookupTestParticipantAges(testTask); lookupTestParticipantEducationTypes(testTask); }); } }

Target:
public void normalize(CertifiedProductSearchDetails listing) { if (listing.getSed() != null && listing.getSed().getTestTasks() != null && listing.getSed().getTestTasks().size() > 0) { listing.getSed().getTestTasks().stream() .forEach(testTask -> { populateTestParticipantAges(testTask); populateTestParticipantEducationTypes(testTask); }); } }
Source:
public String getParsedCheckDetails() { return checkDetails != null ? new String(checkDetails, Charset.forName("US-ASCII")) : ""; }

Target:
public String getParsedCheckDetails() { return checkDetails != null ? new String(checkDetails, StringUtils.getPreferredCharset()) : ""; }
Source:
public void log(AuditLogable auditLogable, AuditLogType logType, String message) { if (!logType.shouldBeLogged()) { return; } EventFloodRegulator eventFloodRegulator = new EventFloodRegulator(auditLogable, logType); if (eventFloodRegulator.isLegal()) { AuditLog[] savedAuditLog = { null }; TransactionSupport.executeInNewTransaction(() -> { savedAuditLog[0] = saveToDb(auditLogable, logType, message); return null; }); if (savedAuditLog == null) { log.warn("Unable to create AuditLog"); } else { logMessage(savedAuditLog[0]); } } }

Target:
public void log(AuditLogable auditLogable, AuditLogType logType, String message) { if (!logType.shouldBeLogged()) { return; } EventFloodRegulator eventFloodRegulator = new EventFloodRegulator(auditLogable, logType); if (eventFloodRegulator.isLegal()) { AuditLog[] savedAuditLog = { null }; TransactionSupport.executeInNewTransaction(() -> { savedAuditLog[0] = saveToDb(auditLogable, logType, message); return null; }); if (savedAuditLog[0] == null) { log.warn("Unable to create AuditLog"); } else { logMessage(savedAuditLog[0]); } } }
Source:
public Entity<TreeReference> getEntity(TreeReference data) { EvaluationContext nodeContext = new EvaluationContext(ec, data); getDetail().populateEvaluationContextVariables(nodeContext); nodeContext.addFunctionHandler(hereFunctionHandler); int length = detail.getHeaderForms().length; Object[] details = new Object[length]; String[] sortDetails = new String[length]; String[] backgroundDetails = new String[length]; boolean[] relevancyDetails = new boolean[length]; int count = 0; for (DetailField f : this.getDetail().getFields()) { try { details[count] = f.getTemplate().evaluate(nodeContext); Text sortText = f.getSort(); Text backgroundText = f.getBackground(); if (sortText == null) { sortDetails[count] = null; } else { sortDetails[count] = sortText.evaluate(nodeContext); } if (backgroundText == null) { backgroundDetails[count] = ""; } else { backgroundDetails[count] = backgroundText.evaluate(nodeContext); } relevancyDetails[count] = f.isRelevant(nodeContext); } catch (XPathSyntaxException | XPathException xpe) { xpe.printStackTrace(); details[count] = "<invalid xpath: " + xpe.getMessage() + ">"; backgroundDetails[count] = ""; relevancyDetails[count] = true; } count++; } return new Entity<>(details, sortDetails, backgroundDetails, relevancyDetails, data); }

Target:
public Entity<TreeReference> getEntity(TreeReference data) { EvaluationContext nodeContext = new EvaluationContext(ec, data); detail.populateEvaluationContextVariables(nodeContext); nodeContext.addFunctionHandler(EntitySelectActivity.hereFunctionHandler); int length = detail.getHeaderForms().length; Object[] details = new Object[length]; String[] sortDetails = new String[length]; boolean[] relevancyDetails = new boolean[length]; int count = 0; for (DetailField f : detail.getFields()) { try { details[count] = f.getTemplate().evaluate(nodeContext); Text sortText = f.getSort(); if (sortText == null) { sortDetails[count] = null; } else { sortDetails[count] = sortText.evaluate(nodeContext); } relevancyDetails[count] = f.isRelevant(nodeContext); } catch (XPathSyntaxException | XPathException xpe) { xpe.printStackTrace(); details[count] = "<invalid xpath: " + xpe.getMessage() + ">"; relevancyDetails[count] = true; } count++; } return new Entity<>(details, sortDetails, relevancyDetails, data); }
Source:
public static AuthenticationProfileRepository getInstance() { return instance; }

Target:
public static AuthenticationProfileRepository getInstance() { if (instance == null) { synchronized (AuthenticationProfileRepository.class) { if (instance == null) { instance = new AuthenticationProfileRepository(); } } } return instance; }
Source:
private OperatingMode getActualMode() throws InvalidOperatingModeException { if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); byte[] readData = new byte[256]; try { if (connectionInterface instanceof AbstractSerialPort) ((AbstractSerialPort)connectionInterface).purge(); connectionInterface.writeData(COMMAND_MODE_AP.getBytes()); Thread.sleep(100); int readBytes = connectionInterface.readData(readData); if (readBytes == 0) return OperatingMode.UNKNOWN; return OperatingMode.get(Integer.parseInt(new String(readData).trim(), 16)); } catch (IOException e) { logger.error(e.getMessage(), e); } catch (InterruptedException e) { logger.error(e.getMessage(), e); } return OperatingMode.UNKNOWN; }

Target:
private OperatingMode getActualMode() throws InvalidOperatingModeException { if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); byte[] readData = new byte[256]; try { if (connectionInterface instanceof AbstractSerialPort) ((AbstractSerialPort)connectionInterface).purge(); connectionInterface.writeData(COMMAND_MODE_AP.getBytes()); Thread.sleep(100); int readBytes = connectionInterface.readData(readData); if (readBytes == 0) return OperatingMode.UNKNOWN; return OperatingMode.get(Integer.parseInt(new String(readData).trim(), 16)); } catch (IOException | NumberFormatException | InterruptedException e) { logger.error(e.getMessage(), e); } return OperatingMode.UNKNOWN; }
Source:
protected int determineMaxQuipHistorySize(int sizeOfQuipGroup){ return Math.min(MAXIMUM_QUIP_HISTORY_SIZE, (int) (sizeOfQuipGroup*MAXIMUM_QUIP_HISTORY_PERCENT)); }

Target:
protected static int determineMaxQuipHistorySize(int sizeOfQuipGroup){ return Math.min(MAXIMUM_QUIP_HISTORY_SIZE, (int) (sizeOfQuipGroup*MAXIMUM_QUIP_HISTORY_PERCENT)); }
Source:
private void invokeOnComplete(final IoCallback callback) { sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } while (next != null) { String next = this.next; IoCallback queuedCallback = this.queuedCallback; this.next = null; this.queuedCallback = null; writer.write(next); if (writer.checkError()) { queuedCallback.onException(exchange, this, new IOException()); } else { sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } } } }

Target:
private void invokeOnComplete(final IoCallback callback) { sendThread = null; inCall = Thread.currentThread(); try { callback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } while (next != null) { String next = this.next; IoCallback queuedCallback = this.queuedCallback; this.next = null; this.queuedCallback = null; writer.write(next); if (writer.checkError()) { queuedCallback.onException(exchange, this, new IOException()); } else { sendThread = null; inCall = Thread.currentThread(); try { queuedCallback.onComplete(exchange, this); } finally { inCall = null; } if (Thread.currentThread() != sendThread) { return; } } } }
Source:
public void shouldNotCreateNewAutoGenerationOptionWithNullParameters() throws Exception { SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", null); autoGenerationOption.add("location", null); autoGenerationOption.add("source", null); autoGenerationOption.add("automaticGenerationEnabled", null); autoGenerationOption.add("manualEntryEnabled", null); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); handle(req); }

Target:
public void shouldNotCreateNewAutoGenerationOptionWithNullParameters() throws Exception { SimpleObject autoGenerationOption = new SimpleObject(); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); handle(req); }
Source:
public boolean performOk() { doGetPreferenceStore().setValue(UIPreferences.WARN_BEFORE_COMMITTING, warnCheckbox.getSelection()); System.out.println(warnCheckbox.getSelection()); System.out.println(blockCheckbox.getSelection()); doGetPreferenceStore().setValue(UIPreferences.BLOCK_COMMIT, blockCheckbox.getSelection()); return super.performOk(); }

Target:
public boolean performOk() { doGetPreferenceStore().setValue(UIPreferences.WARN_BEFORE_COMMITTING, warnCheckbox.getSelection()); doGetPreferenceStore().setValue(UIPreferences.BLOCK_COMMIT, blockCheckbox.getSelection()); return super.performOk(); }
Source:
private boolean run() { try { if (log.isDebugEnabled()) { log.debug("Executing run: " + runSql); } jdbcTemplate.execute(runSql); } catch (DataAccessException e) { lastException = e; return false; } return true; }

Target:
private boolean run() { try { if (log.isDebugEnabled()) { log.debug("Executing run: " + runSql); } jdbcTemplate.execute(runSql); } catch (DataAccessException e) { log.error("Error during run sql", e); lastException = e; return false; } return true; }
Source:
private void processStatus(Position position, long status) { if (!BitUtil.check(status, 0) || !BitUtil.check(status, 1) || !BitUtil.check(status, 3) || !BitUtil.check(status, 4) || !BitUtil.check(status, 7)) { position.set(Position.KEY_ALARM, true); if (!BitUtil.check(status, 0)){ position.set(Position.KEY_ALARM_TYPE, "theft alarm"); } else if (!BitUtil.check(status, 1)){ position.set(Position.KEY_ALARM_TYPE, "robbery alarm"); } else if (!BitUtil.check(status, 3)){ position.set(Position.KEY_ALARM_TYPE, "illegal ignition alarm"); } else if (!BitUtil.check(status, 4)){ position.set(Position.KEY_ALARM_TYPE, "entering alarm"); } else if (!BitUtil.check(status, 7)){ position.set(Position.KEY_ALARM_TYPE, "out alarm"); } } position.set(Position.KEY_IGNITION, !BitUtil.check(status, 10)); position.set(Position.KEY_STATUS, status); }

Target:
private void processStatus(Position position, long status) { if (!BitUtil.check(status, 0) || !BitUtil.check(status, 1) || !BitUtil.check(status, 3) || !BitUtil.check(status, 4) || !BitUtil.check(status, 7)) { if (!BitUtil.check(status, 0)) { position.set(Position.KEY_ALARM, Position.ALARM_VIBRATION); } else if (!BitUtil.check(status, 1)) { position.set(Position.KEY_ALARM, "robbery"); } else if (!BitUtil.check(status, 3)) { position.set(Position.KEY_ALARM, "illegal ignition"); } else if (!BitUtil.check(status, 4)) { position.set(Position.KEY_ALARM, "entering"); } else if (!BitUtil.check(status, 7)) { position.set(Position.KEY_ALARM, "out"); } } position.set(Position.KEY_IGNITION, !BitUtil.check(status, 10)); position.set(Position.KEY_STATUS, status); }
Source:
public boolean isCompatibleWithJavaVersion(Integer version) { return JavaVersionHelper.java8Compatible(version); }

Target:
public boolean isCompatibleWithJavaVersion(Integer version) { return JavaVersionHelper.java8Guaranteed(version); }
Source:
private void extractTablesAndIndexes(PhoenixConnection conn) { String tables = inputTables.trim().split(","); PTable dataTable = null; try { for (String tableName : tables) { HashSet<String> physicalIndexes = new HashSet<>(); dataTable = PhoenixRuntime.getTableNoCache(conn, tableName); String physicalTableName = dataTable.getPhysicalName().getString(); for (PTable indexTable : dataTable.getIndexes()) { if(indexTable.getIndexType().equals(PTable.IndexType.GLOBAL)) { physicalIndexes.add(indexTable.getPhysicalName().getString()); } } HashSet<String> rebuildIndexes = new HashSet<>(); rebuildIndexes.addAll(physicalIndexes); if (MetaDataUtil.hasViewIndexTable(conn, dataTable.getPhysicalName())) { String viewIndexPhysicalName = MetaDataUtil.getViewIndexPhysicalName(physicalTableName); physicalIndexes.add(viewIndexPhysicalName); ResultSet rs = conn.createStatement().executeQuery("SELECT DISTINCT TABLE_NAME FROM " + "SYSTEM.CATALOG WHERE COLUMN_FAMILY = \'"+viewIndexPhysicalName+ "\' AND TABLE_TYPE = \'i\'"); while (rs.next()) { String viewIndexName = rs.getString(1); rebuildIndexes.add(viewIndexName); } } rebuildMap.put(physicalTableName, rebuildIndexes); tablesAndIndexes.put(physicalTableName, physicalIndexes); } } catch (SQLException e) { LOGGER.severe("Exception while splitting tool input "+e); if (dataTable == null) { LOGGER.severe("Unable to find the provided data table"); } } }

Target:
private boolean extractTablesAndIndexes(PhoenixConnection conn) { String tables = inputTables.trim().split(","); PTable dataTable = null; try { for (String tableName : tables) { HashSet<String> physicalIndexes = new HashSet<>(); dataTable = PhoenixRuntime.getTableNoCache(conn, tableName); String physicalTableName = dataTable.getPhysicalName().getString(); HashMap<String, String> rebuildIndexes = new HashMap<>(); if (!dataTable.isTransactional() && dataTable.getType().equals(PTableType.TABLE)) { for (PTable indexTable : dataTable.getIndexes()) { if (indexTable.getIndexType().equals(PTable.IndexType.GLOBAL)) { physicalIndexes.add(indexTable.getPhysicalName().getString()); rebuildIndexes.put(indexTable.getPhysicalName().getString(), GLOBAL_INDEX_ID); } } if (MetaDataUtil.hasViewIndexTable(conn, dataTable.getPhysicalName())) { String viewIndexPhysicalName = MetaDataUtil.getViewIndexPhysicalName(physicalTableName); physicalIndexes.add(viewIndexPhysicalName); ResultSet rs = conn.createStatement().executeQuery( "SELECT DISTINCT TABLE_NAME, TENANT_ID FROM " + "SYSTEM.CATALOG WHERE COLUMN_FAMILY = \'" + viewIndexPhysicalName +"\' AND TABLE_TYPE = \'i\'"); while (rs.next()) { String viewIndexName = rs.getString(1); String tenantId = rs.getString(2); rebuildIndexes.put(viewIndexName, tenantId); } } rebuildMap.put(physicalTableName, rebuildIndexes); tablesAndIndexes.put(physicalTableName, physicalIndexes); } else { LOGGER.info("Skipping Table " + tableName + " because it is "+ (dataTable.isTransactional() ? "transactional" : "not a data table")); } } return true; } catch (SQLException e) { LOGGER.severe("Failed to find list of indexes "+e); if (dataTable == null) { LOGGER.severe("Unable to find the provided data table"); } return false; } }
Source:
public PanelControl(UI ui, Preferences prefs) { this.ui = ui; this.prefs = prefs; setSpacing(10); setPadding(new Insets(0, 10, 0, 10)); ui.registerEvent((IssueSelectedEventHandler) e -> setCurrentlySelectedPanel(Optional.of(e.panelIndex))); ui.registerEvent((PanelClickedEventHandler) e -> setCurrentlySelectedPanel(Optional.of(e.panelIndex))); ui.registerEvent((ShowRenamePanelEventHandler) e -> ((FilterPanel) getPanel(e.panelId)).initRenameHandler()); setupKeyEvents(); }

Target:
public PanelControl(UI ui, Preferences prefs) { this.ui = ui; this.prefs = prefs; setSpacing(10); setPadding(new Insets(0, 10, 0, 10)); ui.registerEvent((IssueSelectedEventHandler) e -> setCurrentlySelectedPanel(Optional.of(e.panelIndex))); ui.registerEvent((PanelClickedEventHandler) e -> setCurrentlySelectedPanel(Optional.of(e.panelIndex))); ui.registerEvent((ShowRenamePanelEventHandler) e -> ((FilterPanel) getPanel(e.panelId)).startRename()); setupKeyEvents(); }