persistence@glassfish.java.net

Re: Code review for issue 1366 - TopLink logging: There is no english translation

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 30 Oct 2006 14:16:38 -0800

Tom,

Can you please look at #2 below? The same problem exists in XMLLogger.java
as well.

thanks,
-marina

Wonseok Kim wrote:
> Hello Marina,
>
> I just wanted to do a quick fix, checking all messages will take a lot
> of time. I checked those messages to be moved by searching them and
> confirmed there is no other code using those messages with more than
> FINE level.
> If another message which is not translated is found, let's reopen the
> issue.
>
> Answers to your comments are in the below.
>
> 1.
> [TopLink Finest]: 2006.10.24
> 04:11:36.681--Thread(Thread[main,5,main])--default_tables_created (There
> is no
> English translation for this message.)
>
> { "default_tables_created", "The table ({0}) is created."},
>
> Above message entry is added, it is used only in SchemaManager (by
> search result) like below, but was missing.
>
> SchemaManager.createDefaultTables()
> ...
> try {
> createObject(tblDef);
> session.getSessionLog().log(SessionLog.FINEST ,
> "default_tables_created", tblDef.getFullName());
> } catch (DatabaseException exception) {
> // Ignore the exception, table already created
> session.getSessionLog().log(SessionLog.FINEST,
> "default_tables_already_existed", tblDef.getFullName());
>
> } finally {
>
> 2.
> [junit] [TopLink Config]: 2006.10.28
> 09:04:40.764--Thread(Thread[main,5,main])--ejb_orm (There is no English
> translation for this message.)
>
> private void handleORMException(
> RuntimeException e,
> String mf,
> boolean throwException){
> if (m_session == null){
> ...
> AbstractSessionLog.getLog().log(SessionLog.CONFIG,
> SessionLog.EJB_ORM,
> EntityManagerSetupImpl.ERROR_LOADING_XML_FILE,
> new Object[] {mf, e});
> } else if (!throwException) {
> // fail quietly
> m_session.log(SessionLog.CONFIG,
> SessionLog.EJB_ORM,
> EntityManagerSetupImpl.ERROR_LOADING_XML_FILE,
> new Object[] {mf, e});
> } else {
> // fail loudly
> m_session.handleException(e);
> }
> }
>
> In above code, AbstractSessionLog.getLog().log() is using category
> SessionLog.EJB_ORM, but as following signature shows, EJB_ORM is used as
> message(SessionLog doesn't have category support log method).
>
> Sessionog.log(int level, String message, Object param1, Object param2);
>
> So could you remove SessionLog.EJB_ORM parameter?
>
> Thanks,
> -Wonseok
>
> On 10/28/06, * Marina Vatkina* <Marina.Vatkina_at_sun.com
> <mailto:Marina.Vatkina_at_sun.com>> wrote:
>
> Hi Wonseok,
>
> Do you want to see partial fixes in or try to solve all the problems?
> Running the e-p-t tests with your changes, I saw ejb_orm as being
> reported
> with no translation (redirect the output, then grep). Also, one of your
> fixes is adding a message for a key that didn't have one - do you have
> a script to check that it's the only one?
>
> thanks,
> -marina
>
> Wonseok Kim wrote:
> > Hi Marina,
> >
> > Please review this. Just moved those messages from
> LoggingLocalization
> > to TraceLocalizationResource which is used for DEBUG and FINEx
> messages.
> > https://glassfish.dev.java.net/issues/show_bug.cgi?id=1366
> >
> > Could you check in this also, if it is okay?
> >
> > Index:
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/LoggingLocalizationResource.java
> > ===================================================================
> > RCS file:
> >
> /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/localization/i18n/LoggingLocalizationResource.java,v
> > retrieving revision 1.16
> > diff -c -r1.16 LoggingLocalizationResource.java
> > ***
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/LoggingLocalizationResource.java
> > 23 Aug 2006 17:41:51 -0000 1.16
> > ---
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/LoggingLocalizationResource.java
>
> > 27 Oct 2006 19:30:36 -0000
> > ***************
> > *** 57,64 ****
> > { "elements", "{0}{1} elements" },
> > { "unitofwork_identity_hashcode", "{0}UnitOfWork identity
> > hashcode: {1}" },
> > { "deleted_objects", "Deleted Objects:" },
> > - { "deleting_object", "The remove operation has been
> performed
> > on: {0}"},
> > - { "register_new_for_persist", "PERSIST operation called on:
> > {0}." },
> > { "all_registered_clones", "All Registered Clones:" },
> > { "new_objects", "New Objects:" },
> >
> > --- 57,62 ----
> > ***************
> > *** 251,259 ****
> > { "weaver_not_overwriting", "Weaver is not overwriting
> class
> > {0} because it has not been set to overwrite."},
> > { "weaver_could_not_write", "Weaver encountered an
> exception
> > while trying to write class {0} to the file system. The
> exception was:
> > {1}"},
> >
> > - { "field_type_set_to_java_lang_string", "The default table
> > generator could not locate or convert a java type ({1}) into a
> database
> > type for database field ({0}). The generator uses '
> java.lang.String' as
> > default java type for the field." },
> > { "relational_descriptor_support_only", "The default table
> > generator currently only supports generating default table schema
> from a
> > relational project."},
> > - { "default_tables_already_existed", "The table ({0}) is
> > already in the database, and won't be created."},
> >
> > { "config_factory", "Config factory: ({0}) = ({1})"},
> > { "class_list_created_by", "Class list created by
> > ({0}).({1})() method."},
> > --- 249,255 ----
> > Index:
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/TraceLocalizationResource.java
> >
> > ===================================================================
> > RCS file:
> >
> /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/localization/i18n/TraceLocalizationResource.java,v
> > retrieving revision 1.4
> > diff -c -r1.4 TraceLocalizationResource.java
> > ***
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/TraceLocalizationResource.java
> > 19 Oct 2006 19:50:24 -0000 1.4
> > ---
> >
> src/java/oracle/toplink/essentials/internal/localization/i18n/TraceLocalizationResource.java
>
> > 27 Oct 2006 19:30:36 -0000
> > ***************
> > *** 57,62 ****
> > --- 57,64 ----
> > { "register_new",
> "Register
> > the new container bean {0}" },
> > { "register_new_bean",
> > "Register the new bean {0}" },
> > { "register",
> "Register the
> > object {0}" },
> > + {
> > "register_new_for_persist", "PERSIST operation called on: {0}." },
> > + { "deleting_object",
> "The
> > remove operation has been performed on: {0}"},
> > { "revert", "Revert the
> > object''s attributes {0}" },
> > { "unregister",
> "Unregister
> > the object {0}" },
> > {
> "begin_batch_statements",
> > "Begin batch statements" },
> > ***************
> > *** 270,276 ****
> > { "deploy_begin", "begin
> > deploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > { "deploy_end", "end
> > deploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > { "undeploy_begin",
> "begin
> > undeploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > ! { "undeploy_end", "end
> > undeploying Persistence Unit {0}; state {1}; deploymentCount {2}"}
> > };
> >
> > /**
> > --- 272,282 ----
> > { "deploy_begin", "begin
> > deploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > { "deploy_end", "end
> > deploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > { "undeploy_begin",
> "begin
> > undeploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > ! { "undeploy_end", "end
> > undeploying Persistence Unit {0}; state {1}; deploymentCount {2}"},
> > !
> > ! {
> > "field_type_set_to_java_lang_string", "The default table
> generator could
> > not locate or convert a java type ({1}) into a database type for
> > database field ({0}). The generator uses ' java.lang.String' as
> default
> > java type for the field." },
> > ! {
> "default_tables_created",
> > "The table ({0}) is created."},
> > ! {
> > "default_tables_already_existed", "The table ({0}) is already in the
> > database, and won't be created."},
> > };
> >
> > /**
> >
> >
> > Thanks,
> > -Wonseok
>
>