New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix message filtering in message tab #1177
Fix message filtering in message tab #1177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments describing small fixes
@@ -35,29 +35,29 @@ | |||
* Logical (ie constructed) size of this bitset, despite the actual size of | |||
* the super bitset that this class is based on | |||
*/ | |||
private int mSize = 0; | |||
private int mSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field is set in constructor either way
/** | ||
* Bitset that buffers bits added one at a time, up to the size of the this | ||
* bitset. | ||
* | ||
* Note: the super class bitset behind this class may have a size larger | ||
* that the size parameter specified. | ||
* @param size | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved dangling JavaDoc to constructor
@@ -75,7 +75,7 @@ private void addFilterSet(FilterSet<T> filterSet, DefaultMutableTreeNode parent) | |||
List<IFilter<T>> filters = filterSet.getFilters(); | |||
|
|||
/* sort the filters in alphabetical order by name */ | |||
filters.sort((Comparator<IFilter<?>>) (first, second) -> first.getName().compareTo(second.getName())); | |||
filters.sort(Comparator.comparing(IFilter::getName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build comparator from method reference
@@ -98,7 +98,7 @@ private void addFilter(Filter<T> filter, DefaultMutableTreeNode parent) | |||
{ | |||
List<FilterElement<?>> elements = filter.getFilterElements(); | |||
|
|||
elements.sort(Comparator.comparing(FilterElement::toString)); | |||
elements.sort(Comparator.comparing(FilterElement::getName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order filter elements by their display name (as above) instead of synthetic toString
@@ -25,17 +25,17 @@ | |||
public interface IByteBufferProvider | |||
{ | |||
/** | |||
* Adds the listener to receive complex buffer samples | |||
* Adds the listener to receive byte buffer samples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match JavaDoc with purpose of the class
@@ -8,7 +8,6 @@ | |||
import java.util.Date; | |||
|
|||
import static io.github.dsheirer.service.radioreference.RadioReference.CheckExpDate; | |||
import static org.junit.Assert.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused JUnit 4 import
@@ -105,7 +105,7 @@ public WaveWriter(AudioFormat format, Path file, long maxSize) throws IOExceptio | |||
*/ | |||
public WaveWriter(AudioFormat format, Path file) throws IOException | |||
{ | |||
this(format, file, Integer.MAX_VALUE * 2); | |||
this(format, file, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of Java type conversion and promotion rules, multiplication of Integer.MAX_VALUE
(of type int
) and 2
(of type int
) will overflow (to type int
) even though the third argument is of type long
.
what we likely want here is to default to MAX_WAVE_SIZE
, so we can pass 0 or just MAX_WAVE_SIZE
if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks maybe this will fix wav recordings (a feature i use) maybe some calls getting cut off after 8 minutes or so on long (large) files
This PR fixes message filtering to the message tab.
In
master
, theDecoderFactory.getMessageFilters
is not referenced at all. It seems that it was (probably mistakenly) deleted in commit 7eec82d "#6 DMR Decoder (#947)" which removed building of filter list inChannelProcessingManager
.What I wasn't sure is if building of the filter list should happen in
MessageActivityPanel
(as in this PR) or during creation of theProcessingChain
(and only referenced fromMessageActivityPanel
).Apart from that, I included fixes of small code issues spotted around the code base. I will leave comments on these describing reason for the change.