Skip to content

Commit

Permalink
prevent serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
xzel23 committed Sep 24, 2024
1 parent 1d655e6 commit 58b6b80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.slf4j.helpers.AbstractLogger;
import org.slf4j.helpers.MessageFormatter;

import java.io.Serial;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -117,7 +118,9 @@ public void setLevel(Level level) {
this.level = level;
}

@Serial
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {throw new java.io.NotSerializableException("com.dua3.utility.logging.slf4j.LoggerSlf4j");}

@Serial
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {throw new java.io.NotSerializableException("com.dua3.utility.logging.slf4j.LoggerSlf4j");}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.logging.log4j.Logger;

import javax.swing.table.AbstractTableModel;
import java.io.Serial;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
Expand Down Expand Up @@ -129,4 +130,9 @@ public void executeRead(Runnable readTask) {
}
}

@Serial
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {throw new java.io.NotSerializableException("com.dua3.utility.swing.LogTableModel");}

@Serial
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {throw new java.io.NotSerializableException("com.dua3.utility.swing.LogTableModel");}
}

0 comments on commit 58b6b80

Please sign in to comment.