Skip to content

Commit daf77eb

Browse files
committedNov 9, 2021
8276337: Use override specifier in HeapDumper
Reviewed-by: stuefe, dholmes
1 parent 93692ea commit daf77eb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎src/hotspot/share/services/heapDumper.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -607,23 +607,23 @@ class DumpWriter : public AbstractDumpWriter {
607607
private:
608608
CompressionBackend _backend; // Does the actual writing.
609609
protected:
610-
virtual void flush(bool force = false);
610+
void flush(bool force = false) override;
611611

612612
public:
613613
// Takes ownership of the writer and compressor.
614614
DumpWriter(AbstractWriter* writer, AbstractCompressor* compressor);
615615

616616
// total number of bytes written to the disk
617-
virtual julong bytes_written() const { return (julong) _backend.get_written(); }
617+
julong bytes_written() const override { return (julong) _backend.get_written(); }
618618

619-
virtual char const* error() const { return _backend.error(); }
619+
char const* error() const override { return _backend.error(); }
620620

621621
// Called by threads used for parallel writing.
622622
void writer_loop() { _backend.thread_loop(); }
623623
// Called when finish to release the threads.
624-
virtual void deactivate() { flush(); _backend.deactivate(); }
624+
void deactivate() override { flush(); _backend.deactivate(); }
625625
// Get the backend pointer, used by parallel dump writer.
626-
CompressionBackend* backend_ptr() { return &_backend; }
626+
CompressionBackend* backend_ptr() { return &_backend; }
627627

628628
};
629629

@@ -701,7 +701,7 @@ class ParDumpWriter : public AbstractDumpWriter {
701701
bool _split_data;
702702
static const uint BackendFlushThreshold = 2;
703703
protected:
704-
virtual void flush(bool force = false) {
704+
void flush(bool force = false) override {
705705
assert(_pos != 0, "must not be zero");
706706
if (_pos != 0) {
707707
refresh_buffer();
@@ -742,8 +742,8 @@ class ParDumpWriter : public AbstractDumpWriter {
742742
}
743743

744744
// total number of bytes written to the disk
745-
virtual julong bytes_written() const { return (julong) _backend_ptr->get_written(); }
746-
virtual char const* error() const { return _err == NULL ? _backend_ptr->error() : _err; }
745+
julong bytes_written() const override { return (julong) _backend_ptr->get_written(); }
746+
char const* error() const override { return _err == NULL ? _backend_ptr->error() : _err; }
747747

748748
static void before_work() {
749749
assert(_lock == NULL, "ParDumpWriter lock must be initialized only once");
@@ -757,7 +757,7 @@ class ParDumpWriter : public AbstractDumpWriter {
757757
}
758758

759759
// write raw bytes
760-
virtual void write_raw(const void* s, size_t len) {
760+
void write_raw(const void* s, size_t len) override {
761761
assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large");
762762
debug_only(_sub_record_left -= len);
763763
assert(!_split_data, "Invalid split data");
@@ -778,7 +778,7 @@ class ParDumpWriter : public AbstractDumpWriter {
778778
set_position(position() + len);
779779
}
780780

781-
virtual void deactivate() { flush(true); _backend_ptr->deactivate(); }
781+
void deactivate() override { flush(true); _backend_ptr->deactivate(); }
782782

783783
private:
784784
void allocate_internal_buffer() {

0 commit comments

Comments
 (0)
Please sign in to comment.