This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 42259 - Allow to ignore old deserialized classes
Summary: Allow to ignore old deserialized classes
Status: RESOLVED INVALID
Alias: None
Product: ide
Classification: Unclassified
Component: Import Settings (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: API
Depends on: 42412
Blocks:
  Show dependency tree
 
Reported: 2004-04-21 13:10 UTC by Petr Jiricka
Modified: 2008-12-22 22:02 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2004-04-21 13:10:03 UTC
Currently, there is framework in the core IDE that
allows renaming serialized classes, so old
settings can be read using classes with new names.
This is achieved using mappings specified in
META-INF/netbeans/translate.names.

It would be useful if this file also allowed to
specify that the old setting does not have an
equivalent any more, and that it can be safely
ignored (i.e. map old names to null). 

This would be useful for compiler types,
executors, debugger types, but also for other
settings, e.g. dataloaders.
Comment 1 Jesse Glick 2004-04-23 16:32:26 UTC
For data loaders this would be useful.... though I think loaders.ser
won't store old loaders explicitly unless they were customized (which
is possible but unusual).

For services (e.g. CompilerType's), AFAIK nothing amiss should happen
if you have some old *.settings files, so long as nobody is actually
asking Lookup for CompilerType - the InstanceCookie.Of should not try
to load the class unless someone wants it. Right?

Anyway services were generally stored in the project settings area in
NB 3.x rather than in the main user dir, so NB 4.0 would just ignore
them anyway (even if the upgrade wizard did not do anything about them
and you just kept the user dir). So this would not cause any problems.
AFAIK. Needs to be checked.
Comment 2 Petr Jiricka 2004-04-23 16:44:27 UTC
Thanks for the info. So you are saying that modules can just delete
the old executors/debugger types without worries, right?

How about for DataLoaders? Can modules just delete old loaders? Or
should some work in core be done before we can start deleting loaders?
Comment 3 _ rkubacki 2004-04-23 17:12:56 UTC
add DataLoaders - some non-NetBeans modules can modify loaders to
extend their functionality (Sun Java Studio added some actions to
loaders defined in web modules in the past AFAIK)

Services can really be OK. What about .nbattrs files? 
Comment 4 Jesse Glick 2004-04-23 18:33:48 UTC
IMHO we should kill support for .nbattrs; they will be nearly useless
in 4.0. No compiler type/executor/debugger type per file. Source file
encoding should be a per-project attr (dkonecny will work on this
API). Code synchronization is held in MDR. The only remaining use cases:

1. Marking files with odd extensions as text files. But we should just
provide an editor cookie for DefaultDataObject and kill the text
module, or something. The current system is just stupid.

2. Preferred data loader, for whatever this is good for. Yarda has
some experimental module to manipulate it.

Even if we still need file attrs for a few cases, IMHO masterfs should
store them in the user dir, not alongside the files - no one wants
this stuff cluttering up their source tree. I filed #42412.

I would go ahead and kill old compiler, executor, and debugger type
classes (as is already done for many modules). No way we want to keep
them in the source base.
Comment 5 _ ttran 2004-04-23 22:21:56 UTC
> 1. Marking files with odd extensions as text files. But we should just
> provide an editor cookie for DefaultDataObject and kill the text
> module, or something. The current system is just stupid.

fully agreed.  Treat all unknown files as text.  If we want to do better 
we can detect the binary files (any '\0' in the first 2KB) and refuse
to  open them.  Those can be edited/viewed in a hex editor in a
distant future 

Radek, please file a P3 task, mark it with core-promod and assign it
to yourself :-)  Thanks
Comment 6 _ ttran 2004-04-23 22:25:12 UTC
added core-promod to keep this on my radar

I think this issue will become a non-issue.  It's tied to how we want
to   import user settings from 3.6 to 4.0.  Until now the upgrade code
just copy over everything with a few exceptions.  For 3.6 -> 4.0 we'll
copy only selected .settings files, the likely candidates are
shortcuts and editor settings
Comment 7 _ ttran 2004-05-07 10:06:13 UTC
closing as INVALID and remove core-promod

For upgrading from an older version to 4.0 the upgrade utility will
copy over only a selected subset of .settings files.  Modules can go
ahead and safely delete their old classes which are there only because
of deserializing old settings.  META-INF/netbeans/translate.names
could be deleted too.
Comment 8 Jesse Glick 2004-05-07 22:39:07 UTC
Trung maybe you should locate translate.names | xargs cvs rm -f or
something.
Comment 9 _ ttran 2004-05-07 22:47:33 UTC
locate?  I am used to 'find . -name ..."  Once we delete all those
translate.names I guess we still should keep the code which does this
magic, for future.  Right?
Comment 10 Jesse Glick 2004-05-07 23:23:11 UTC
Do "man locate". Also http://www.geekreview.org/slocate/

Re. keeping the code - sure I guess, though we should try harder to
not serialize stuff!
Comment 11 _ ttran 2004-05-07 23:56:47 UTC
I've deleted all translate.names in stable modules except form and
i18n/form.  Not sure if form doesn't need those things for something
special

CC tpavek
Comment 12 Jesse Glick 2004-05-08 00:03:42 UTC
Yes, I think form uses them to load ancient serialized .form files or
something, best not to touch that.
Comment 13 Tomas Pavek 2004-05-10 08:54:43 UTC
Form uses translate names only for the JTable model property editor
class name - it was moved from core to form module not so long ago,
there could be still forms using the old name. The icon editor will
probably go the same way, so there is still some use for the translate
names files.

i18n/form should be kept - there could be many forms still refering to
the old class names (in this case the i18n property editor).

(Don't need to tell me that storing the property editor class names in
form files was not good idea. ;)
Comment 14 _ rkubacki 2004-05-12 16:34:13 UTC
It seems that we can delete couple of ModuleInstall classes too -
applet (not in build now, I know), extbrowser, html and maybe some
others too.
Comment 15 _ ttran 2004-05-12 17:18:30 UTC
Radim, just do it.  Thanks
Comment 16 _ rkubacki 2004-05-13 20:10:47 UTC
I went through ModuleInstall classes and removed empty ones (beans,
extbrowser, i18n, properties, web/taglibed, xml/catalog, xml/core,
xml/tools)