package org.rocket.network.props;

import org.rocket.network.MutProp;
import org.rocket.network.NetworkClient;
import org.rocket.network.PropId;
import org.rocket.network.PropValidator;

public class PropPresenceValidator implements PropValidator {
    private final PropId pid;

    public PropPresenceValidator(PropPresence annotation) {
        this.pid = PropIds.type(annotation.value());
    }

    @Override
    public void validate(NetworkClient client) {
        MutProp<Object> prop = client.getProp(pid);

        if (!prop.isDefined()) {
            throw new AssertionError(String.format(
                    "Prop %s must have a value",
                    prop.getId()));
        }
    }
}

@@ -271,16 +271,49 @@
 pId pid;
+%0A    private String messageError;
 %0A%0A    pu
@@ -415,24 +415,114 @@
 n.value());%0A
+        this.messageError = String.format(%0A            %22Prop %25s must have a value%22, pid);%0A
     %7D%0A%0A    @
@@ -706,105 +706,20 @@
 ror(
-String.format(%0A                    %22Prop %25s must have a value%22,%0A                    prop.getId())
+messageError
 );%0A 

Build the error message earlier