我正在使用一个具有枚举类型且具有此类const的库; 通用标签

在Eclipse中调试时,出现错误: 通用标签

当我使用土耳其语系统时,在i>İ上存在问题,但是由于这是一个枚举常量,即使我将每个属性都设置为UTF-8,也无法得到 STRING 是Eclipse应该寻找的东西。但是它仍在寻找STRİNG,但找不到,我无法使用它。我该怎么办?

项目>属性>资源>文本文件编码现在为UTF-8。问题不断。

编辑:更多信息可能会提供一些我无法获得的线索; 我正在研究OrientDB。这是我的第一次尝试,因此我不知道问题是否可能出在OrientDB软件包上。但是我正在使用其他许多库,但从未见过这样的问题。该程序包中有一个OType枚举,我只是尝试连接到数据库。 通用标签

我没有更多的代码了。创建数据库,但随后我得到了java.lang.IllegalArgumentException 通用标签

这是OType类: http://code.google.com/p/orient/source/browse/trunk/core/src/main/java/com/orientechnologies/orient/core/metadata /schema/OType.java

和其他班级; OCommandExecutorSQLCreateProperty: http://code.google.com/p/orient/source/browse/trunk/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java

第81行说:type = OType.valueOf(word.toString());

有帮助吗?

解决方案

我是否正确地假设您正在使用土耳其语区域设置运行该程序?然后,该错误似乎在OCommandExecutorSQLCreateProperty的第118行中: 通用标签

您必须指定应使用其大写字母规则的语言环境,可能将Locale.ENGLISH用作toUpperCase的参数。

其他提示

This problem is related to your database connection. Presumably, there's a string in OrientDB somewhere, and you are reading it, and then trying to use it to select a member of the enum.

I'm assuming in the code that you posted that the variable word comes from data in the database. If it comes from somewhere else, then the problem is the 'somewhere else'. If OrientDB, for some strange reason, returns 'STRİNG' as metadata to tell you the type of something, then that is indeed a defect in OrientDB.

If that string actually contains a İ, then no Eclipse setting will have any effect on the results. You will have to write code to normalize İ to I.

If you dump out the contents of 'word' as a sequence of hex values for the chars of the string, I think you'll see your İ staring right at you. You have to change what's in the DB to have a plain old I.

Unfortunately, it is related with regional setting, locale of your OS which is Turkish.

Two work around options :

1. Change your regional settings to English-US

2. Give encoding to she jvm as command line param for setting locale to English

    -Duser.language=en -Duser.region=EN

I have created bug reports for xmlbeans, exist and apache cxf for the same issue. Enumeration toUpper is the point of the exception.

Some related links:

https://issues.apache.org/jira/browse/XMLSCHEMA-22

http://mail-archives.apache.org/mod_mbox/xmlbeans-user/201001.mbox/%3CSNT123-DS11993DD331D6CA7799C46CF6650@phx.gbl%3E

http://mail-archives.apache.org/mod_mbox/cxf-users/201203.mbox/%3CBLU0-SMTP115A668459D9A0DA11EA5FAF6460@phx.gbl%3E

https://vaadin.com/forum/-/message_boards/view_message/793105

http://comments.gmane.org/gmane.comp.apache.cxf.user/18316

One work-around is to type Type.ST and then press Ctrl-space. Eclipse should auto-complete the variable name without you having to figure out how to enter a dotless capital I on a Turkish keyboard. :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top