#915385 aptitude: manually installed flag set in the UI not preserved

Package:
aptitude
Source:
aptitude
Description:
terminal-based package manager
Submitter:
Vincent Lefevre
Date:
2018-12-03 12:18:04 UTC
Severity:
normal
#915385#5
Date:
2018-12-03 12:15:44 UTC
From:
To:
Package pdftk has been replaced by pdftk-java. Thus in the upgrade
from the aptitude curses UI, pdftk was selected as upgraded and
pdftk-java was selected as newly installed (as a dependency of
pdftk). Since I did not want to keep the transitional dummy package
pdftk, I marked pdftk-java as manually installed by typing 'm'
(thus the 'A' disappeared as expected) and marked pdftk to be
purged by typing '_'. Then I did the upgrade with 'gg'.

But after quitting aptitude, "apt install -f" said:

The following packages were automatically installed and are no longer required:
  libcommons-lang3-java pdftk-java
Use 'apt autoremove' to remove them.

and when I ran aptitude again, aptitude proposed to remove pdftk-java.