File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/main/java/com/rabbitmq/stream/impl Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 2121import com .rabbitmq .stream .StreamException ;
2222import com .rabbitmq .stream .compression .Compression ;
2323import java .lang .reflect .Field ;
24+ import java .lang .reflect .Modifier ;
2425import java .time .Duration ;
2526import java .util .function .Function ;
2627import java .util .function .ToIntFunction ;
@@ -242,11 +243,13 @@ public Producer build() {
242243 StreamProducerBuilder duplicate () {
243244 StreamProducerBuilder duplicate = new StreamProducerBuilder (this .environment );
244245 for (Field field : StreamProducerBuilder .class .getDeclaredFields ()) {
245- field .setAccessible (true );
246- try {
247- field .set (duplicate , field .get (this ));
248- } catch (IllegalAccessException e ) {
249- throw new StreamException ("Error while duplicating stream producer builder" , e );
246+ if (!Modifier .isStatic (field .getModifiers ())) {
247+ field .setAccessible (true );
248+ try {
249+ field .set (duplicate , field .get (this ));
250+ } catch (IllegalAccessException e ) {
251+ throw new StreamException ("Error while duplicating stream producer builder" , e );
252+ }
250253 }
251254 }
252255 return duplicate ;
You can’t perform that action at this time.
0 commit comments