how to edit `.class` file in Maven dependency in Eclipse

You cannot edit .class file(s). You can only edit java file(s) contained in the source code and recompile.

The sources that are downloaded by maven are a project SNAPSHOT generated by the maven source plugin for a given project at a given time, to aid in investigating the code, but certainly not to modify it.

These sources can be bound to the classpath and used for navigating the project source in an IDE, but they still remain read-only.