Can we change data in string object.

Can we change data in string object.

Saw this hack to access the char[]'s in a String in another thread. Beware that the effects of doing this is possible errors, like incorrect hashCode etc.
import java.lang.reflect.*;
public class SharedString {
        public static Constructor stringWrap = null;
        public static String wrap(char[] value, int offset, int length) {
                try {
                        if (stringWrap == null) {
                                stringWrap = String.class.getDeclaredConstructor(new Class[] { Integer.TYPE, Integer.TYPE, char[].class });
                                stringWrap.setAccessible(true);
                        return (String)stringWrap.newInstance(new Object[] { new Integer(offset), new Integer(length), value });
                catch (java.lang.NoSuchMethodException e) {
                        System.err.println ("NoMethod exception caught: " + e);
                catch (java.lang.IllegalAccessException e) {
                        System.err.println ("Access exception caught: " + e);
                catch (java.lang.InstantiationException e) {
                        System.err.println ("Instantiation exception caught: " + e);
                catch (java.lang.reflect.InvocationTargetException e) {
                        System.err.println ("Invocation exception caught: " + e);
                return null;
        public static void main(String[] args) {
                char[] chars = new char[] { 'l', 'e', 'v', 'i', '_', 'h' };
                String test = SharedString.wrap(chars, 0, chars.length);
                System.out.println("String test = " + test);
                chars[0] = 'k';
                chars[1] = 'a';
                chars[2] = 'l';
                chars[3] = 'l';
                chars[4] = 'a';
                chars[5] = 'n';
                System.out.println("String test = " + test);
} Gil

Similar Messages

  • Can't change the connection string of SSIS package with derived columns?

    We upgraded SQL server 2008 to 2012, copied and converted all SSIS packages from Visual Studio 2008 to 2010.  When I opened a package in VS 2010 and tried to change the connection string, in the local connection managers, if the data source is another
    SSIS package B(.dtsx file) with derived columns, I can't change the connection string of package B. When I opened the file connection manager editor for package B and tried to locate a dtsx file in another location, saved the change, reopened the project.
    Package B still pointed to previous file.  Other packages without derived columns work fine. Any thoughts?

    We are using the package deployment model and refer to other packages in the same project. If
    we changed the path of package B (with derived columns) to "D:\Visual Studio 2010\xxxx", and refer it in package A, in the A's connection manager, the connection string of package B is still its previous location  "D:\Visual
    Studio 2008\xxxx". When we ran the package A in the SQL server agent, the data source is still
     "D:\Visual
    Studio 2008\xxxx", so how can I change it to "D:\Visual
    Studio 2010\xxxx"? Why has the package C (without derived columns) no such problem? thanks.

  • How can I change dates to the UK format, DD/MM/YY, in Mac Numbers?

    How can I change dates in Mac Numbers to the UK format of DD/MM/YY? When I correct them individually they automatically return to the US format.

    Open System Preferences, then click the "Languages & Region" pane in the first row.
    Change the Region from "United States" to "United Kingdom"

  • How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?

    If you use the WCF-SQL adapter it is recommend that you set UseAmbientTransaction to true if you are changing data. I think this requires MSDTC to be enabled on the SQL server that you are changing the data on. (http://msdn.microsoft.com/en-us/library/dd787981.aspx)
    I think that Availability groups does not support MSDTC. (http://msdn.microsoft.com/en-us/library/ms366279.aspx).
    How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?

    Hi,
    Yes, Availability groups doesn't support MSDTC. Please refer to the similar discusison which maybe helpfull:
    http://dba.stackexchange.com/questions/47108/alwayson-ag-dtc-with-failover
    http://stackoverflow.com/questions/17179221/msdtc-in-always-on-availability-groups

  • Can not change date from 2011 to 2012 in Elements 9 photoshop

    can not change dates from 2011 to 2012 in Elements 9 photoshop

    Thanks for the help. That was exactly  the fix I needed. With the expense of the photoshop software you'd think the company would fix stuff like this via updates. Merry Christmas.

  • How can I change data carriers on my ipad?

    How can I change data carriers on my ipad mini?

    Get a plan from a different carrier and insert the sim they give you.

  • Sapcar returns error "can't change date of file"

    I am preparing to apply SPS12 to my ERP6.0 system.
    when I run sapcar -xvf "*.?ar", I get the following error:
    "can't change date of file EPS/in/CSN01120061532_0026976.ATT
    invalid argument."
    note: I am using the latest sapcar version 7.00 running under the local&domain admin account.
    Did anyone run into this problem before?

    We have the same error
    processing archive /sapcd/sap/ECC6/JCE_Policy_Files/90000115.CAR...
    x Changelog.txt
    can't change date of file Changelog.txt
    Invalid argument
    How did you fix it ?
    Regards,
    Madhan

  • Can not change data in Input Ready Query

    All,
    I have created an input ready query on an aggreagation level which has one transactional cube underlying it however, after run the query I am unable to change data in the cells even though I get a warning message saying query is ready for input
    Note:
    1. The underlying realtime cube is in "Planning Mode:Loading not allowed" state in rsa1
    2. I tried including all characteristics so that the record can be uniquely identified at that aggregation level).
    3. I am not using any characteristic restrictions
    4. I have not set any data slices
    5. I have set the property for Planning "Start query in Change Mode"
    6. I have set the 'Key Figure' Planning Properties to "Can be changed Manually or via Planning Functions" for the key figures
    7. I do not have currency/unit in row/column.
    8. There are any locks occurring
    Any pointers welcome.
    Thanks,
    Milind

    Hi Milind,
    Was wondering how was your problem solved. I get the same message when I run the query in web from query designer and in bex analyzer the cells are not updated with the changes that I make.
    I am hitting my head against the wall to figure what could be the problem as my plan query is simply based on aggregation level created directlty upon the real time info cube.
    Have cross checked all the points that you mentioned in this post but I cells do not change.
    There should be some way around to solve this problem.
    Thanks

  • How can i change date and time after importing a file

    hello
    i'm importing AVI files first in iMovie because Final doesn't support (other question i put in) but when i see the scenes form 1993 they have the date 2004.
    i believe 2004 is the date i put them on the computer.
    Now i looked in the help files Final Cut Pro but cant find anything to adjust the date and time.
    it works well in iMovie using the help files:
    Right-click the clip you wish to edit and click Adjust Clip Date and Time from the menu that appears. Or click on Archive and than adjust date and time
    But as i said i cant import the files in FCP have to import them to  iMovie files adjust the date and than import to Final Cut Pro but than de changes i made to the date and time  are gone and in FCP 2004 is again the date of the file!!!
    Question how can i Change in Final Cut Pro the date and time in a same way as iMovie does?
    Jemajoro

    OK, I think I understand what you are saying but it still does not look like it is doing it as you describe.
    Here is another screen shot.
    Note that all clips in "2007 August" event have the date of Aug x, 2007.
    Yet, the event "2007 August" still shows up under the 2012 "folder" (is that the right terminology?).
    The newest clip in this event is Aug 31, 2007 so shouldn't it be categorized as 2007 and not 2012?
    I think you know this but I am using the following feature:
    Go to the sprocket icon under the events.
    Select "Group events by date" and then by "group events by year and month"
    Thanks again for all the help

  • How can i change date format in portal?

    how can i change the date format in the portal to dd-mmm-yyyy format 
    (e.g. 02-MAR-2007 or 02/ MAR/ 2007)
    i know that i have to change one of the properties listed in the path
    (systen administration->system config->Knowledge management-> content management->global services->property metadata->properties)
    but which property should i change and what should I modify it to?
    Nikhil

    Hi Nikhil,
    please have a look at SAP note <a href="https://service.sap.com/sap/support/notes/816761">816761</a> for solving this.
    Hope it helps,
    Robert

  • Can't change date and time

    Just purchased an Envy 7640. I got it set up correctly to run wirelessly, and can print from all my machines. However, I can't change the date and time. I got into Settings>Preferences>Date and confirm the date and click Done, then go into Time, and change the time, and again click Done. However, it never actually changes, and I see a "Date/Time Not Set" on the main screen.

    Hello @JeffK_1969, 
    Welcome to the HP forums.
    I understand that your Envy 7640 is not accepting the date and time.
    I would like to help.
    Reset the printer
    Press the Power button to turn on the printer.
    With the power on, disconnect the power cord from the rear of the printer.
    Wait 60 seconds.
    Reconnect the power cord to rear of the printer.
    Press the Power button to turn on the printer.
    Then try to set the date and time again.
    If it still will not accept teh date and time, I would call technical support,
    Please call our technical support at 800-474-6836.
    If you live outside the US/Canada Region, please click the link below to get the support number for your region. http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    Aardvark1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!

  • Can't change date format in Pages

    Normally you should be able to rightclick and select "Change date & time...", or doubbleclick on a inserted date to change its format.
    I have 2 Macs with Lion 10.7.2 and Pages where nothing happens everything is up to date. Language is Danish.
    Tried deleting the pages prefs.
    Complete delete, reinstall and upgrade of iWorks to 9.1 (Pages 4.1 (923))
    Nothing helps.
    In addition Pages hangs on exit after trying to "Change date & time..." a few times.
    Any clues?

    Hi! I can reproduce the problems when setting my Pages to Danish with the application Language switcher. I think we've had a discussion about this in this forum before.
    Using "date time danish" I find 5 threads about the same issue. It is a bug in the Danish localisation language.

  • Can't change date on iPhoto 6

    All my pictures, regardless of when I imported them, show the date as 5/1/2006.
    I've tried altering them manually in the "information" box, but although it allows me to change them it then reverts them all to 5/1/2006.
    I have tried "photos > batch change" but the drop-down menu doesn't appear so I can't change anything that way.
    The date on my system and all other programmes is correct.
    I'm a fairly new Mac user, and as yet haven't learned how to re-install etc (thankfully not needed to so far) so if there is anything anyone can suggest could you please explain as if to an 8-year old child!
    Thanks in advance !

    chillum
    Back Up and try rebuild the library: hold down the apple and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
    If that doesn't help:
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • Can't Change date on Windows 7, If I try to, computer freezes.

    Just recently my computer thought it'd be fun to go back in time, and it changed its date back to 12/31/2000. This is causing loads of errors on numerous games and websites, (website security certificate not yet valid, etc). I try to simply click at the bottom right, or go to the control panel and "change date and time", but if I "apply" those changes, my computer freezes on the spot. From my understanding through the use of Bootcamp I have no access to Windows 7 BIOS, so I don't know what to do.
    Thanks in Advance

    Hi
    The best way to uninstall IE 11 or IE 10 is to go to the control panel.
    Double click the Programs and features Icon.
    On the left hand side click on "View installed updates"
    Scroll through the list until you find IE 11, it should be under a heading called "Microsoft Windows"
    Click on IE11 and then click on the Uninstall button at the top.
    Reboot your machine and you should be back to IE10.
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Can CDC (Change Data Capture) Can be used for Audit / Trail Purposes

    Hi,
    My question is bit subjective in nature. I playing around with CDC to implement a Database Auditing solution and it's seems to be working fine. However my question is for experts and for those who have already used CDC for this purpose. Is it feasible to
    use it for Data Auditing? Has anybody successfully used it? Any important considerations or configurations you have worked out e.g. CDC cleanup time etc
    I will highly appreciate any feed back.
    Thanks,
    Ali
    Saadat

    Refer this link...I hope this link will answer all your questions
    http://blogs.technet.com/b/josebda/archive/2009/03/24/sql-server-2008-change-tracking-ct-and-change-data-capture-cdc.aspx
    -Prashanth

Maybe you are looking for

  • 6 Plus: Screen rotation for pre-installed apps

    Having a bit of an argument on this one with the fiance, so some input would be greatly appreciated: With the Phone app on the iPhone 6 Plus, is the screen supposed to rotate or not? My fiance called Apple Support and was told that it was supposed to

  • End jump after each chapter

    I have DSP 4.2.0 I want the DVD to jump back to the menu page after each chapter is finished. Can someone direct me on how to do this? I tried under "connections" setting it up, but it didn't work. Gerry

  • I have Macbook Pro on order, should I wait for new "iBook"?

    I'll be using the mac for the iLife software mostly. iMovie, iPhoto and Garageband. How much do you think the price difference and speed difference will be? I'm pretty sure I'm sticking with the MacBook Pro. I've got the stock 1.83 on order, after re

  • Streaming  PDF Documents Using JAVA

    Hello Geeks, I want to develop a document viewer which gets embedded in web browser. Are there any JAVA API available for this ? I am confused where to start.

  • Why can't I upgrade from OSX 10.6.8 to Mountain Lion?

    I've tried to buy the app, I've tried to search for the answer, I've tried to ignore how far I am falling behind, but now I just need to get it done. But I can't. Please help.