Skip to main content

Need Help - I am not even a beginner in Java :(

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
rrypo123
Offline
Joined: 2012-12-13

Hi ,

Firstly I am at stage 0 in java. Well I have never been into any programming, but it seems like I need a little help to solve a task. I have been given a code and asked to incorporate it to fix an error.

here's the code -

4a5
> import java.net.*;
225c226,227
< String file = fileElem.getAttribute("URI");
---
> String file = URLDecoder.decode(fileElem.getAttribute("URI"), "UTF-8");
> log.info(file);
486c488
< String file = fileElem.getAttribute("URI");
---
> String file = URLDecoder.decode(fileElem.getAttribute("URI"), "UTF-8");

It is a simple URL encoding issue which could be fixed by incorporating this code. But I am too dumb that I don't even know how to do it!
Well there is a program used to decode files, But it has got simple URL encoding issue, which could be fixed by code given above.

Please have a look at the below links so you will get a clear very clear Idea.
https://tag3ulp55xczs3pn.onion.to/
https://tag3ulp55xczs3pn.onion.to/requiem-3.3.5-win.zip
https://tag3ulp55xczs3pn.onion.to/requiem-3.3.5-src.zip - source code

https://tag3ulp55xczs3pn.onion.to/cg...a448&offset=40

The above links are to a program used to decode files. its a freeware, and the source code is too available. the particular version that works for me is 3.3.5 but unfortunately it has a URL encoding issue. The developer of that program gave me the fix to the issue and has asked me to incorporate it and fix it for myself. But I as I said I have never been into any programming, and I really don't understand anything here. But I would really appreciate it if some one will teach me how to do it step-by-step and how to fix it!

Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rwlarsen
Offline
Joined: 2008-03-28

This is a patch file. You would use the patch command in Linux/Unix. I'm certain there is a port for windows. this should be applied to one of the source code files.

the numbers are lines in the file.
a means add a line.
c means change a line.

< indicates the referenced line from the old file
> indicates the line should be inserted into the new file

Once the appropriate source file is patched, the application must be built. if the developer provides instructions on building the app from the source, they should not change.

rrypo123
Offline
Joined: 2012-12-13

Thanks for your generous efforts and help. I have successfully finished this task :)

hvongmongmanh90_lc
Offline
Joined: 2013-01-06

i need help. what is MASON ? I would like the program 'foraging behavior reviews' on MASON to simulate the mutil agent