导出的 eclipse 首选项包含 \!/=

Exported eclipse preferences contain \!/=

我从 eclipse 产品中导出了首选项,以便将它们与我的 plugin_customization.ini 文件进行比较。导出的 *.epf 文件的前两行如下:

#Wed Jul 25 10:59:27 EEST 2018 \!/=

\!/=是什么意思?
我也在我维护的 plugin_cusotomization.ini 文件中注意到它,但它出现在文件的中间。

这是用于此首选项保存的 Eclipse 首选项 (IEclipsePreferences) 中的节点名称。

! 指定这是一个首选项节点定义(前面的 \ 只是一个属性文件转义)。 / 是根节点的路径。 属性 没有价值。

此代码在 org.eclipse.core.internal.preferences.PreferencesService

private static final char EXPORT_ROOT_PREFIX = '!';
private static final float EXPORT_VERSION = 3;
private static final String VERSION_KEY = "file_export_version"; //$NON-NLS-1$

public IStatus exportPreferences(IEclipsePreferences node, OutputStream output, String[] excludesList) throws CoreException {

    ... other code

    properties = convertToProperties(node, excludesList);
    if (properties.isEmpty())
        return Status.OK_STATUS;
    properties.put(VERSION_KEY, Float.toString(EXPORT_VERSION));
    properties.put(EXPORT_ROOT_PREFIX + node.absolutePath(), EMPTY_STRING);