Why can't I concatenate the JSON? - java

I need to concatenate all BasicDBObject in BasicDBList . Every time the loop runs, my BasicDBObject contains only ONE json element and exit my BasicDBList contains nothing. Why does this happen? Put the dbLinha.clear() to avoid duplicate but evaluating the code each time the loop runs BasicDBList contains a duplicate!
public BasicDBList readMetadados(Planilha planilha) {
List<String> cabecalho = new ArrayList<>();
int linhaReferencia = 0;
BasicDBObject dbLinha = new BasicDBObject();
BasicDBList listLinha = new BasicDBList();
try {
InputStream planilhaFile = new FileInputStream(FileUtils.getFile(UPLOAD_PATH, planilha.getPath()));
Sheet linhaInicial = new XSSFWorkbook(planilhaFile).getSheetAt(0);
Iterator<Row> rowIterator = linhaInicial.iterator();
while (rowIterator.hasNext()) {
Row row = rowIterator.next();
Iterator<Cell> cellIterator = row.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
try {
if (cell.getCellType() != 3) {
if (cell.getCellType() == 1) {
if ("Veículo".equals(cell.getStringCellValue())) {
linhaReferencia = cell.getRow().getRowNum();
cabecalho.add(cell.getStringCellValue());
while (cellIterator.hasNext()) {
cabecalho.add(cellIterator.next().getStringCellValue());
}
break;
}
}
if (linhaReferencia != 0) {
switch (cell.getCellType()) {
case Cell.CELL_TYPE_FORMULA:
dbLinha.append(cabecalho.get(cell.getColumnIndex()), cell.getCellFormula());
break;
case Cell.CELL_TYPE_BOOLEAN:
dbLinha.append(cabecalho.get(cell.getColumnIndex()), cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_NUMERIC:
dbLinha.append(cabecalho.get(cell.getColumnIndex()), cell.getNumericCellValue());
break;
default:
dbLinha.append(cabecalho.get(cell.getColumnIndex()), cell.getStringCellValue());
}
}
}
} catch (IllegalStateException e) {
Log.info(this, "Erro ao obter valor da linha [{}] e coluna [{}]", cell.getRow().getRowNum(), cell.getColumnIndex());
}
}
if (!dbLinha.isEmpty()) {
for(int i = 0; i < cabecalho.size(); i++){
if(!dbLinha.containsKey(cabecalho.get(i))){
dbLinha.append(cabecalho.get(i), " ");
}
}
listLinha.add(dbLinha);
dbLinha.clear();
}
}
} catch (FileNotFoundException e) {
Log.error(this, "Erro ao processar planilha: Planilha não encontrada.", e);
} catch (IOException e) {
Log.error(this, "Erro ao processar planilha.", e);
}
System.out.println(listLinha.toString());
return listLinha;
}
Output
[ { } , { } , { } , { } , { } , { }]
The content of BasicDBList the first time you run is correct, the second time is starting to duplicate and replace with added anteriormentes.
The value of BasicDBList the first time you run the loop ("if (!dbLinha.isEmpty())")
Second time

You are trying to save objects by using clear and using the same object (dbLinha) over and over again. That won't work.
When you add an object to a list, it adds a reference to that object, not a copy of that object to the list. So basically, what you add the first time is a reference to the dbLinha object, and now you have the first item in the list pointing to the same object that dbLinha is set to.
Then you call dbLinha.clear().
This means that the reference stored in your list, being the same, will now show an empty object. Then you read another line into the same object, add another reference to it to the list, and then clear it again.
Your list gets filled with references to the one, single, object that you are re-using. Here is a demonstration of what is happening:
If you want to retain your objects, you have to use new, not clear. You have to create a new object to store the next bit of data, because adding to the list does not create a copy, just a reference. So you basically have to let the reference you added point to the old object, and start with a new one.

Related

Unit test for method containing switch case statement and insert to db

I have a method that contains a switch case block which iterates through an excel file to obtain values to write to a db.
I need to write a unit test for this method but I have no idea where to start.Below is the method of which I need to write the unit test for. If anyone could advise me it would be greatly appreciated.
public void loadAccount() throws Exception {
Connection conn = null;
PreparedStatement insert = null;
Properties props = new Properties();
try {
conn = connMan.allocateConnection();
conn.setAutoCommit(false);
insert = conn.prepareStatement(INSERT_SQL_TOP_ACCOUNTS);
FileInputStream inputStream = new FileInputStream("path");
props.load(inputStream);
String excelFilePath = props.getProperty("Account");
FileInputStream iStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(iStream);
Sheet firstSheet = workbook.getSheetAt(0);
Iterator<Row> iterator = firstSheet.iterator();
// Current date for entry into db
java.sql.Date sqlDate = new java.sql.Date(System.currentTimeMillis());
insert.setDate(1, sqlDate);
// Skips the header row
iterator.next();
// Iterate through the first sheet and get the cell values
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Iterator<Cell> cellIterator = nextRow.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
int columnIndex = cell.getColumnIndex();
switch (columnIndex) {
case 0:
String institution = cell.getStringCellValue();
insert.setString(2, institution);
break;
case 1:
// Formatting data because of alphanumeric mix in row
DataFormatter formatter = new DataFormatter();
String dept = formatter.formatCellValue(cell);
insert.setString(3, dept);
break;
case 2:
int hits = (int) cell.getNumericCellValue();
insert.setInt(4, hits);
break;
case 3:
int visitors = (int) cell.getNumericCellValue();
insert.setInt(5, visitors);
break;
}
}
insert.addBatch();
}
int[] insertCount = insert.executeBatch();
int successInserted = 0;
for (int item : insertCount) {
if (item == 1) {
successInserted++;
}
}
log.info("There're " + insertCount.length + " need to be inserted, with successfully [" + successInserted
+ "] inserted");
conn.commit();
} catch (Exception e) {
log.error("Exception in loadAccount:" + e);
try {
conn.rollback();
} catch (SQLException e1) {
log.error("Exception when rollback the loading.", e1);
throw e1;
}
throw e;
} finally {
connMan.closeStatement(insert);
try {
if (conn != null) {
connMan.deallocateConnection(conn);
}
} catch (SQLException e) {
log.error("Exception in loadAccount:" + e);
throw e;
}
}
}
First of all to faciliate easy testing, you should make sure (as in "refactor until") your method does only one thing (reading an excel file, extracting values and writing to a db are at least three things). Going the Test-Driven-Development-Path would have left you with these separate methods in first place.
Then you should grab your prefered mocking framework and mock away the db access since using a real db would be an integration test and not an unit test.
After that you should test your new methods one by one. Preferably you added one 'mastermind' that faciliates calling the other methods and collectiong results so you could test your methods without invoking the others. Call your methods with fixed values (preferably edge and error cases) and use your prefered unit testing framework to assert the returns.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException TreeMap [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 6 years ago.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at dacia.Principale.jButton10ActionPerformed(Principale.java:1204)
at dacia.Principale.access$500(Principale.java:44)
Code:
XSSFWorkbook wg= new XSSFWorkbook();
XSSFSheet sht=wg.createSheet();
TreeMap<String,Object[]> data= new TreeMap<>();
// data.put("-1",new Object[]){"chasis","marque","couleur","nom client","date d entree","date sortie","telephone","numero WW","position","mode paiment","gamme","version"});
data.put("-1",new Object[]{jTable2.getColumnName(0),jTable2.getColumnName(1),jTable2.getColumnName(2),jTable2.getColumnName(3),jTable2.getColumnName(4),jTable2.getColumnName(5),jTable2.getColumnName(6),jTable2.getColumnName(7),jTable2.getColumnName(8),jTable2.getColumnName(9),jTable2.getColumnName(10),jTable2.getColumnName(11)});
for(int i=0;i<jTable2.getRowCount();i++)
{
data.put(Integer.toString(i),new Object[]{jTable2.getValueAt(i,0).toString(),jTable2.getValueAt(i,1).toString(),jTable2.getValueAt(i,2).toString(),jTable2.getValueAt(i,3).toString(),jTable2.getValueAt(i,4).toString(),jTable2.getValueAt(i,5).toString(),jTable2.getValueAt(i,6).toString(),jTable2.getValueAt(i,7).toString(),jTable2.getValueAt(i,8).toString(),jTable2.getValueAt(i,9).toString(),jTable2.getValueAt(i,10).toString(),jTable2.getValueAt(i,11).toString()});
}
//write to excel
Set <String> ids=data.keySet();
XSSFRow row ;
int roow=0 ;
for (String st : ids)
{
row=sht.createRow(roow++);
Object[] values=data.get(st);
int cellId=0 ;
for(Object o : values)
{
Cell cell=row.createCell(cellId++);
cell.setCellValue(o.toString());
}
}
try {
//write to file
FileOutputStream fos= new FileOutputStream(new File("/home/elprincipe/Desktop/dacia.xls"));
wg.write(fos);
fos.flush();
fos.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Principale.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Principale.class.getName()).log(Level.SEVERE, null, ex);
}
The problem is in:
data.put(Integer.toString(i),new Object[]{jTable2.getValueAt(i,0).toString(),jTable2.getValueAt(i,1).toString(),jTable2.getValueAt(i,2).toString(),jTable2.getValueAt(i,3).toString(),jTable2.getValueAt(i,4).toString(),jTable2.getValueAt(i,5).toString(),jTable2.getValueAt(i,6).toString(),jTable2.getValueAt(i,7).toString(),jTable2.getValueAt(i,8).toString(),jTable2.getValueAt(i,9).toString(),jTable2.getValueAt(i,10).toString(),jTable2.getValueAt(i,11).toString()});
From what I can tell by your code, something in your jTable2 is not getting initialized properly.
The idea of a NullPointerException is that you are trying to use an object that hasn't been created yet. Since you are able to iterate over the jTable2, and you don't have an index out of bounds exception, I would say that one of the elements of the jTable2 is not being created
What I would suggest is going over this in the debugger, carefully analyzing each row of the table before you try to convert it to a String
Also, (this is more of a style thing, but I think it'll help you in the long run) you should move this sort of functionality into another method, so that it'll be easier to read:
for(int i = 0; i < jTable2.getRowCount(); i++) {
data.put(convertRow(jTable2, i));
}
public Object[] convertRow(Table jTable2, int row) {
rowLength = jTable2[0].length;
Object[] row = new Object[rowLength];
for (int i = 0; i < rowLength; i++) {
Object datum = jTable2.getValueAt(row, i);
if (datum != null) {
row[i] = datum.toString();
}
else {
row[i] = "Null entry"
}
}
return row
}
I promise you this will make debugging much much easier
Java documentation https://docs.oracle.com/javase/8/docs/api/java/util/TreeMap.html#put-K-V-:
Returns: the previous value associated with key, or null if there was
no mapping for key. (A null return can also indicate that the map
previously associated null with key.)
NullPointerException - if the specified key is null and this map uses
natural ordering, or its comparator does not permit null keys
I have no idea what your trying to put in.. but i would check if you might be putting in a null value.

Why clearing the arraylist is clearing the other arraylist even after the completely the assigning the value?

I have created a two list. First list is of some class type(Syncgroupset) and second list is arraylist of type string. This syncgroupset class contain getter and setter for the arraylist of type list.
I will be parsing the xml and copying the parsed values to the list type of class(syncgroupset).
Please find the xml as below.
<syncgroupsettings>
<syncgroupset id = "sgMS" labelid = "lblMS" enabled = "YES" default = "OFF">
<syncgroup syncgroupname = "VISITS"/>
<syncgroup syncgroupname = "CUSTOMERS"/>
</syncgroupset>
<syncgroupset id = "sgAS" labelid = "lblAS" enabled = "YES" default = "ON">
<syncgroup syncgroupname = "SALESDOCS"/>
<syncgroup syncgroupname = "ANALYTICS"/>
</syncgroupset>
</syncgroupsettings>
Please find the code as below
public List<Syncgroupset> parse(XmlPullParser parser) {
String id = "";
String synlabelid="";
String enabled = "";
String default1 = "";
String syngroupname = "";
List<Syncgroupset> mysynset = new ArrayList<Syncgroupset>();
try {
int eventType = parser.getEventType();
List<String> mysyname = new ArrayList<String>();
while (eventType != XmlPullParser.END_DOCUMENT) {
String tagname = parser.getName();
switch (eventType) {
case XmlPullParser.START_TAG:
if(tagname.equalsIgnoreCase("labels"))
{
skip(parser);
}else
if (tagname.equalsIgnoreCase("syncgroupsettings")) {
// do nothing
}else
if (tagname.equalsIgnoreCase("syncgroupset")) {
syncgroupset = new Syncgroupset();
id = parser.getAttributeValue(ns,"id");
synlabelid = parser.getAttributeValue(ns,"labelid");
enabled = parser.getAttributeValue(ns,"enabled");
default1 = parser.getAttributeValue(ns,"default");
syncgroupset.setLabelid(synlabelid);
syncgroupset.setEnabled(enabled);
syncgroupset.setDefault(default1);
syncgroupset.setId(id);
mysynset.add(syncgroupset);
}else
if(tagname.equalsIgnoreCase("syncgroup"))
{
syngroupname = parser.getAttributeValue(ns,"syncgroupname");
mysyname.add(syngroupname);
}
break;
case XmlPullParser.TEXT:
break;
case XmlPullParser.END_TAG:
if (tagname.equals("syncgroupset")) {
mysynset.get(mysynset.size() - 1).setSyncgroup(mysyname);
mysyname.clear();
}
break;
default:
break;
}
eventType = parser.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return mysynset;
}
When i encounter the syncgroup tag, i will be copying the values to other list of type string. I'm not adding syncgroup value to list of type class here only.
When i encounter the end tag of syncgroupsetting, then only i'm adding list of type string to the list of type class by replacing.
Then i'm clearing the list of type string. When i do like this, it is even clearing the list which is inside the list of class. Could you please let me know where i'm doing wrong.
It seems that Syncgroupset keeps a shallow copy of the list you pass to it with setSyncgroup(list). That's why list.clear() affects the Syncgroupset too.
Change this line:
mysynset.get(mysynset.size() - 1).setSyncgroup(mysyname);
To this:
mysynset.get(mysynset.size() - 1).setSyncgroup(new ArrayList<String>(mysyname));
That way, it will be not mysyname passed to it,
but a fresh new list with all elements of mysyname copied,
and then mysyname.clear() can in no way affect the list passed with that setSyncgroup call.

Generics and type erasure in Java issue

I currently face the following issue:
I am trying to refactor a recursive algorithm to an iterative one. What this recursive algorithm does is this:
method1 is passed some initial parameters. Based on a processing that takes place at the beginning of method1, method2 is invoked with these parameters. Now method2 uses some conditions and based on the one that is satisfied method1 is invoked again with the appropriate parameters.
Now, based on the answer on the link I've provided above I did the same thing. But I have to pass parameters around so I did this:
Stack<ArrayList<Object>> stack (the stack for the ArrayList<Object> objects)
ArrayList<Object> parametersForSync = new ArrayList<Object>();
ArrayList<Object> paramForHandle = new ArrayList<Object>();
(Each array list of objects is a list of the parameters to be passed to both the methods. The first array list is for the first method and the second for the second method.)
Assuming I pop and push array lists down the stack correctly I face the following issue which is my main problem and the reason of this question:
Within method2 I have to check whether the object (that was on the array list and is passed to the method) is an instanceof another class of mine. Now I have some conditions there which do not get satisfied when in fact they should.
Is this because of java's type erasure?
Is there anyway to overcome this?
If am not clear at a certain point in my explanations please ask me to clarify.
Edit:
What follows is the code that replaces the recursion that goes like this:
syncWithServer(parameter set x){
handleResultArray(parameter set y);
};
handleResultArray(parameter set ){
syncWithServer(parameter set w)
}
===========================================================
Stack<ArrayList<Object>> stack = new Stack<ArrayList<Object>>();
ArrayList<Object> paramList = new ArrayList<Object>();
paramList.add(oeHelper);
paramList.add(false);
paramList.add(domain);
paramList.add(null);
paramList.add(true);
paramList.add(10000);
paramList.add(true);
stack.push(paramList);
int counter = 0;
ArrayList<Object> parametersForSync = new ArrayList<Object>();
ArrayList<Object> paramForHandle = new ArrayList<Object>();
while (!stack.isEmpty()) {
Log.d(TAG, "Loop: " + counter);
parametersForSync = stack.pop();
paramForHandle = ((OEHelper) parametersForSync.get(0))
.syncWithServer(
// why error here?
(boolean) parametersForSync.get(1),
(OEDomain) parametersForSync.get(2),
(List<Object>) parametersForSync.get(3),
(boolean) parametersForSync.get(4),
(int) parametersForSync.get(5),
(boolean) parametersForSync.get(6));
parametersForSync = ((OEHelper) paramForHandle.get(3))
.handleResultArray(
(OEFieldsHelper) paramForHandle.get(0),
(JSONArray) paramForHandle.get(1),
(boolean) paramForHandle.get(2));
if (parametersForSync.size() != 0) {
stack.push(parametersForSync);
}
counter++;
Now the first method:
public ArrayList<Object> syncWithServer(boolean twoWay, OEDomain domain,
List<Object> ids, boolean limitedData, int limits,
boolean removeLocalIfNotExists) {
Log.d(TAG, "syncWithServer");
List<OEColumn> dbCols = mDatabase.getDatabaseColumns();
List<OEColumn> dbFinalList = new ArrayList<OEColumn>();
ArrayList<Object> parametersList = new ArrayList<Object>();
Log.d(TAG, "Columns & finalList created");
for (OEColumn col : dbCols) {
if (!mOne2ManyCols.contains(col.getName())) {
dbFinalList.add(col);
}
}
OEFieldsHelper fields = new OEFieldsHelper(dbFinalList);
try {
if (domain == null) {
domain = new OEDomain();
}
if (ids != null) {
domain.add("id", "in", ids);
}
if (limitedData) {
mPref = new PreferenceManager(mContext);
int data_limit = mPref.getInt("sync_data_limit", 60);
domain.add("create_date", ">=",
OEDate.getDateBefore(data_limit));
}
if (limits == -1) {
limits = 50;
}
Log.d(TAG, "*****.search_read() started");
JSONObject result = *****.search_read(mDatabase.getModelName(),
fields.get(), domain.get(), 0, limits, null, null);
Log.d(TAG, "***.search_read() returned");
mAffectedRows = result.getJSONArray("records").length();
parametersList.add(fields);
parametersList.add(result.getJSONArray("records"));
parametersList.add(removeLocalIfNotExists);
parametersList.add(OEHelper.this);
//This parametersList contains the parameters that must be used to invoke the next method
Now the second method:
=================================================
public ArrayList<Object> handleResultArray(
OEFieldsHelper fields, JSONArray results,
boolean removeLocalIfNotExists) {
Log.d(TAG, "handleResultArray");
ArrayList<Object> parametersList = new ArrayList<Object>();
// ArrayList<Object> parameterStack = new ArrayList<Object>();
try {
fields.addAll(results);
List<OERelationData> rel_models = fields.getRelationData();
Log.d(TAG, "rel_models: "+rel_models.size());
for (OERelationData rel : rel_models) {
// Handling many2many records
if (rel.getDb().getClass()==OEManyToMany.class
/*instanceof OEManyToMany*/) {//TODO type erasure?
Log.v(TAG, "Syncing ManyToMany Records");
OEManyToMany m2mObj = (OEManyToMany) rel.getDb();
OEHelper oe = ((OEDatabase) m2mObj.getDBHelper())
.getOEInstance();
parametersList.add(oe);
parametersList.add(false);
parametersList.add(null);
parametersList.add(rel.getIds());
parametersList.add(false);
parametersList.add(0);
parametersList.add(false);
return parametersList;
} else if (rel.getDb().getClass()==OEManyToOne.class
/*instanceof OEManyToOne*/) {
// Handling many2One records
Log.v(TAG, "Syncing ManyToOne Records");
// M2OCounter++;
OEManyToOne m2oObj = (OEManyToOne) rel.getDb();
OEHelper oe = ((OEDatabase) m2oObj.getDBHelper())
.getOEInstance();
parametersList.add(oe);
parametersList.add(false);
parametersList.add(null);
parametersList.add(rel.getIds());
parametersList.add(false);
parametersList.add(0);
parametersList.add(false);
// parametersMap.put(Counter, parametersList);
// parameterStack.add(parametersList);
return parametersList;
} else if (rel.getDb().getClass()==OEOneToMany.class
/*instanceof OEOneToMany*/) {
Log.v(TAG, "Syncing OneToMany Records");
// O2MCounter++;
OEOneToMany o2mObj = (OEOneToMany) rel.getDb();
OEHelper oe = ((OEDatabase) o2mObj.getDBHelper())
.getOEInstance();
oe.setOne2ManyCol(o2mObj.getColumnName());
parametersList.add(oe);
parametersList.add(false);
parametersList.add(null);
parametersList.add(rel.getIds());
parametersList.add(false);
parametersList.add(0);
parametersList.add(false);
// parametersMap.put(Counter, parametersList);
// parameterStack.add(parametersList);
return parametersList;
} else {
Log.v(TAG, "Syncing records with no relations"
+ rel.getDb().getClass().getSimpleName());
OEHelper oe = ((OEDatabase) rel.getDb()).getOEInstance();
parametersList.add(oe);
parametersList.add(false);
parametersList.add(null);
parametersList.add(rel.getIds());
parametersList.add(false);
parametersList.add(0);
parametersList.add(false);
return parametersList;//TODO when nothing matches this returns
}
}
List<Long> result_ids = mDatabase.createORReplace(
fields.getValues(), removeLocalIfNotExists);
mResultIds.addAll(result_ids);
mRemovedRecordss.addAll(mDatabase.getRemovedRecords());
} catch (Exception e) {
e.printStackTrace();
}
return parametersList;
}
The second method is supposed to return from within one of the conditions but none of the conditions is met
No - it is not a type erasure problem. As Oracle says:
Type erasure ensures that no new classes are created for parameterized
types; consequently, generics incur no runtime overhead.
So at runtime your classes are just plain classes and your objects are what they are, but it is not going to remove the base type information.
Why not put a log statement in and print out the class of the object?

Selenium WebDriver with Java - how to add "else" condition

I have code:
public void setList(By localizator, String v_value {
Select some_list = new Select(driver.findElement(localizator));
for(WebElement position_list : some_list.getOptions()) {
if(position_list.getText().equalsIgnoreCase(v_value)) {
some_list.selectByVisibleText(position_list.getText());
break;
}
}
}
How can I add condition: if selenium doesn't find position_list.getText().equalsIgnoreCase(v_value) then system throw new RuntimeExpression?
Use iterator instead of foreach, it provides a hasNext() method with which you can check if you are currently dealing with the last element of your list.
Iterator<WebElement> iterator = some_list.getOptions().iterator();
and then instead of your foreach:
while(iterator.hasNext()) {
WebElement current = iterator.next();
if(current.getText().equalsIgnoreCase(v_value)) {
current.selectByVisibleText(position_list.getText());
break;
}
if(!iterator.hasNext()){
throw new RuntimeException();
}
}
Just a suggestion from what I see in your code.
When you use some_list.selectByVisibleText(position_list.getText()); the selectByVisibleText(..) method is already setup to iterate over all available options and select the one that matches the text parameter you pass in. Putting the call inside a loop checking for the option to be available is not ideal if you are looking to throw an exception.
Also, let's say you have the following code -
public void setList(By localizator, String v_value {
Select some_list = new Select(driver.findElement(localizator));
some_list.selectByVisibleText(position_list.getText());
....
}
In this case selectByVisibleText would throw a NoSuchElementException("Cannot locate element with text: " + text); in case the option is not available for selection. You should be able to catch that and throw a runtime exception.
I guess a simple answer to your question is a try catch
public void setList(By localizator, String v_value {
Select some_list = new Select(driver.findElement(localizator));
for(WebElement position_list : some_list.getOptions()) {
try{
if(position_list.getText().equalsIgnoreCase(v_value)) {
some_list.selectByVisibleText(position_list.getText());
break;
}
}
catch(RuntimeExpression ex)
{
...
}
}
}

Categories