String (final LocatableEvent event) { final Location location = event.location(); final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location); String locationFileName = DebuggerUtilsEx.getSourceName(location, e -> getFileName()); final int locationLine = location.lineNumber(); if (event instanceof ModificationWatchpointEvent modificationEvent) { final ObjectReference object = modificationEvent.object(); final Field field = modificationEvent.field(); if (object != null) { return JavaDebuggerBundle.message( "status.field.watchpoint.reached.modification", field.declaringType().name(), field.name(), modificationEvent.valueCurrent(), modificationEvent.valueToBe(), locationQName, locationFileName, locationLine, object.uniqueID() ); } return JavaDebuggerBundle.message( "status.static.field.watchpoint.reached.modification", field.declaringType().name(), field.name(), modificationEvent.valueCurrent(), modificationEvent.valueToBe(), locationQName, locationFileName, locationLine ); } if (event instanceof AccessWatchpointEvent accessEvent) { final ObjectReference object = accessEvent.object(); final Field field = accessEvent.field(); if (object != null) { return JavaDebuggerBundle.message( "status.field.watchpoint.reached.access", field.declaringType().name(), field.name(), locationQName, locationFileName, locationLine, object.uniqueID() ); } return JavaDebuggerBundle.message( "status.static.field.watchpoint.reached.access", field.declaringType().name(), field.name(), locationQName, locationFileName, locationLine ); } return null; }