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 108906 - I18N - regenerate enterprise samples to fix compilation warnings related to encoding
Summary: I18N - regenerate enterprise samples to fix compilation warnings related to e...
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords: I18N
Depends on:
Blocks: 120529
  Show dependency tree
 
Reported: 2007-07-04 19:11 UTC by Ken Frank
Modified: 2008-07-21 15:49 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Frank 2007-07-04 19:11:05 UTC
please reassign to correct subcat - I didn't see one for samples.

part of this might be related to new project encoding property and part is
related to encoding handling for generating javadoc

assumption here is that it is ok for user to change some labels or other ui
items part of using the sample.
And it might be that the created project might have multibyte in it anyway if
project name has multibyte
in it and thats used as name of package or class, or that date is part of the
temate and so would have mbyte characters in it.

0. this is for the enterprise sample projects -  this case is where  the encoding of
the project is not changed - the default case now for enterprise projects is that
utf-8 encoding is used but if encoding was changed in another project, that
encoding becomes the global encoding value.

1. when multibyte is added to some label and thus its then in the java code,
when compiling the project
or when generating javadoc, some warnings about encoding are shown but the
project and javadoc compiles ok.

2.  the fix for javadoc has been filed for various  project types; the fix relates
to javadoc.encoding property defined in the project.properties
wasn't used only defined.
 
3. the regeneration of the sample projects for nb6 could help with these
warning since the build-impl.xml
will also be regenerated.   Tomas can provide more information on these topics.
 
4. Also, these samples might have jsp or html files in them and the 
encoding value used in creation of these files is different than in past, and
works with the new project
encoding, so regeneration of the samples might help those files in the samples 
to be compatible with that.
Comment 1 Tomasz Slota 2007-08-09 10:03:09 UTC
Ken, can you please tell more clearly what is the problem (incl. steps to reproduce) and how to address it (if you know it)? This looks like a fragment of a 
longer email and I have a feeling it is missing important context info.
Comment 2 Ken Frank 2007-08-09 18:10:29 UTC
I need to reinstall another nb to see what exceptions but the info below, based on conversations
with Tomas Zezula, was that the regeneration was needed in any case due to handling javadoc encoding
and new feq in general; basically the problem seen was that with sample project with some mbyte in it,
even in a string the user might change,that since prev samples was assuming encoding was that of
locale user is in, but new feq has default encoding of utf8, that these warnings were seen;
Tomas can give you better explanation of all this.

ken.frank@sun.com
Comment 3 Ken Frank 2007-08-09 19:28:09 UTC
also, the ent samples use the encoding of the locale user is in instead of feq value, so it seems 
regeneration of them just for that aspect will be helpful.

ken.frank@sun.com
Comment 4 Ken Frank 2007-09-18 18:41:51 UTC
removing incomplete keyword since more info was provided; 
the enterprise category samples do not have project encoding as that of the current global project encoding
value but rather use the encoding of the locale user is in; which was how it was in the past nb but not now.

regular ent projects like ejb project do use the value of global proj encoding to set its project encoding.

please fix soon if possible as needed for consistency with all other projects and samples.

other sample projects have regen samples to take care of this or are in progress to do so.
please talk with Tomas to see what else is needed to do as to this situation; see notes below for some
topics.

ken.frank@sun.com
Comment 5 Ken Frank 2007-10-03 18:56:47 UTC
please confirm this will be done soon for nb6 since we need consistency about this for all sample projects; this
actually seems like a p2 issue if the samples use a different project encoding than regular j2ee projects.

ken.frank@sun.com
Comment 6 Tomas Mysik 2007-10-31 12:45:38 UTC
I will look at it.
Comment 7 Andrei Badea 2007-10-31 16:50:04 UTC
I don't see much point in regenerating the samples (or actually, I see point in it, but it is too much work for too
little to gain). They are samples, and as such they are permitted to be in a given encoding (most likely UTF-8) IMHO.
The behavior of the J2SE projects should be modified to be the same. By the way, the J2SE samples are not regenerated
currently; their encoding is set to the default one, but the files are not regenerated to that encoding. So the project
is broken if the default encoding was e.g. UTF-16. Will file an issue for that soon.

By the way, are the samples localized? That is, are the strings in e.g. JSP pages in the samples translated to e.g.
Japanese in the Japanese version of NetBeans? If the samples are not localized, they can just use UTF-8. And if they are
localized, they can either use UTF-8 too, or we can give you support to set an arbitrary encoding.

Suggest setting the encoding of the samples to UTF-8 and closing this issue.
Comment 8 Tomas Mysik 2007-10-31 16:55:55 UTC
Clean-up of project.properties files.
Adding Dan to CC because of testing whether Java EE samples can be created, deployed, debugged etc. Thanks, Dan, 
please let me know if any error occurs.

Checking in 
j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-app-client/nbproject/project.properties,v  
<--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in 
j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-ejb/nbproject/project.properties,v  
<--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/AnnotationOverrideInterceptor/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-ejb/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-war/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/CustomerCMP/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/DukeStateful/DukeStateful-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/DukeStateful-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/DukeStateful/DukeStateful-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/DukeStateful-ejb/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/DukeStateful/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in 
j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/InterceptorStateless/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/JsfJpa/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/JsfJpa/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/JsfJpaCrud/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/JsfJpaCrud/nbproject/project.properties,v  <--  project.properties
new revision: 1.2; previous revision: 1.1
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-war/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/ServletStateless/ServletStateless-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/ServletStateless-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/ServletStateless/ServletStateless-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/ServletStateless-war/nbproject/project.properties,v  <--  
project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/ServletStateless/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/WebJpa/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/WebJpa/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Comment 9 Ken Frank 2007-10-31 17:49:06 UTC
from last 2 comments, I just want to make sure the situation -
in next to last comment it says that they dont need to be regenerated
but then there is some checkins of code, so I just want to be clear for testing.

as to j2se, I really thought they had been some time ago, and web samples
regen was fixed today 108903. When I have project encoding of euc-jp for example,
then create new j2se sample, anagram game, its proj encoding is also euc-jp.

as to the questions:
By the way, are the samples localized? That is, are the strings in e.g. JSP pages in the samples translated to e.g.
Japanese in the Japanese version of NetBeans? If the samples are not localized, they can just use UTF-8. And if they are
localized, they can either use UTF-8 too, or we can give you support to set an arbitrary encoding.

-->no, the samples are not translated themselves; there has never been request from
translators that they felt it was impt.  

finally, as to why it was felt at all that samples needed to be regen, it was related to
feq implemenation and the info I had about that was in the original submission info of this issue.

ken.frank@sun.com

ken.frank@sun.com
Comment 10 Andrei Badea 2007-11-01 14:05:33 UTC
As explained in desc8, the code that was commited to the Java SE and web samples doesn't work correctly. It only sets
the project encoding to the default one, but doesn't recode the sample files to that encoding. It is too much work for
too little gain to write correct code to recode the files.

The commit in desc9 is this issue is just a cleanup.

So to recap:

- the code which sets the project encoding for the Java SE and web samples will be reverted.
- all samples will have the project encoding set to UTF-8.
Comment 11 Tomas Mysik 2007-11-01 16:32:25 UTC
Fixed. Dan, please verify. Thank you.

Checking in 
j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-app-client/nbproject/project.properties,v  
<--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in 
j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/AnnotationOverrideInterceptor-ejb/nbproject/project.properties,v  
<--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/AnnotationOverrideInterceptor/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/AnnotationOverrideInterceptor/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-ejb/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/CustomerCMP/CustomerCMP-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/CustomerCMP-war/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/CustomerCMP/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/CustomerCMP/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/DukeStateful/DukeStateful-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/DukeStateful-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/DukeStateful/DukeStateful-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/DukeStateful-ejb/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/DukeStateful/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/DukeStateful/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in 
j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/InterceptorStateless-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/InterceptorStateless/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/InterceptorStateless/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/JsfJpa/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/JsfJpa/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/JsfJpaCrud/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/JsfJpaCrud/nbproject/project.properties,v  <--  project.properties
new revision: 1.3; previous revision: 1.2
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-app-client/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-app-client/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/LotteryAnnotation-war/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/LotteryAnnotation/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/LotteryAnnotation/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/ServletStateless/ServletStateless-ejb/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/ServletStateless-ejb/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/ServletStateless/ServletStateless-war/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/ServletStateless-war/nbproject/project.properties,v  <--  
project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/ServletStateless/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/ServletStateless/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Checking in j2ee/samples/samples_src/WebJpa/nbproject/project.properties;
/cvs/j2ee/samples/samples_src/WebJpa/nbproject/project.properties,v  <--  project.properties
new revision: 1.4; previous revision: 1.3
done
Comment 12 kaa 2008-07-21 15:49:57 UTC
Product Version: NetBeans IDE Dev (Build 20080715190616)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)

1. Enterprise samples use UTF-8 project encoding even if a user set up win-31j his in previous project.
2. Compilation works without errors if multi byte chars were used code
3. Javadoc was generated ok.