@Override
	public void transform(@Nonnull JvmTransformerContext context, @Nonnull Workspace workspace,
	                      @Nonnull WorkspaceResource resource, @Nonnull JvmClassBundle bundle,
	                      @Nonnull JvmClassInfo initialClassState) throws TransformationException {
		// Create mappings for classes and members with illegal names.
		// Anything that already has a name in the current mappings will be ignored.
		IntermediateMappings mappings = context.getMappings();
		String ownerName = initialClassState.getName();
		if (ILLEGAL_NAME_FILTER.shouldMapClass(initialClassState) && mappings.getMappedClassName(ownerName) == null)
			mappings.addClass(ownerName, NAME_GENERATOR.mapClass(initialClassState));
		for (FieldMember field : initialClassState.getFields()) {
			String fieldDesc = field.getDescriptor();
			String fieldName = field.getName();
			if (ILLEGAL_NAME_FILTER.shouldMapField(initialClassState, field) && mappings.getMappedFieldName(ownerName, fieldDesc, fieldName) == null)
				mappings.addField(ownerName, fieldDesc, field.getName(), NAME_GENERATOR.mapField(initialClassState, field));
		}
		for (MethodMember method : initialClassState.getMethods()) {
			String methodDesc = method.getDescriptor();
			String methodName = method.getName();
			if (ILLEGAL_NAME_FILTER.shouldMapMethod(initialClassState, method) && mappings.getMappedMethodName(ownerName, methodDesc, methodName) == null)
				mappings.addMethod(ownerName, methodDesc, method.getName(), NAME_GENERATOR.mapMethod(initialClassState, method));
		}
	}
A transformer that renames classes and members that are not valid Java identifiers.

@author Matt Coley
recaf-core/src/main/java/software/coley/recaf/services/deobfuscation/transform/generic/IllegalNameMappingTransformer.java