mklaehn commented on a change in pull request #3676:
URL: https://github.com/apache/netbeans/pull/3676#discussion_r815298848
##########
File path:
platform/api.search/src/org/netbeans/modules/search/ui/ResultsOutlineCellRenderer.java
##########
@@ -58,24 +58,29 @@ public Component getTableCellRendererComponent(JTable
table, Object value,
Property<?> property = (Property<?>) value;
try {
String valueString = getDisplayValue(property);
- if (property.getName().equals("path")) { //NOI18N
- renderer = super.getTableCellRendererComponent(table,
- computeFitText(table, row, column, valueString),
- isSelected, hasFocus, row, column);
- setToolTip(renderer, property);
- } else if (property.getName().equals("size")) {
//NOI18N
- renderer = super.getTableCellRendererComponent(table,
- formatFileSize((Long) property.getValue()),
- isSelected, hasFocus, row, column);
- setToolTip(renderer, property);
- } else if (property.getName().equals("lastModified")) {
//NOI18N
- renderer = super.getTableCellRendererComponent(table,
- formatDate((Date) property.getValue()),
- isSelected, hasFocus, row, column);
- setToolTip(renderer, property);
- } else {
- renderer = super.getTableCellRendererComponent(table,
+ switch (property.getName()) {
Review comment:
If you're suggesting that `property.getName()` may be null, a value that
by convention shall not be null, is preset to an empty String and is the
default value for `FeatureDescriptor.getDisplayName()` and
`FeatureDescriptor.getShortDescription()` should they be unset and blindly used
in `Property.equals(Object)` then something is horrificably wrong.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists