Author: pete.muir(a)jboss.org
Date: 2010-06-16 14:09:37 -0400 (Wed, 16 Jun 2010)
New Revision: 6453
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java
Log:
minor tidyup
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java
===================================================================
---
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java 2010-06-16
18:03:38 UTC (rev 6452)
+++
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java 2010-06-16
18:09:37 UTC (rev 6453)
@@ -29,7 +29,6 @@
import java.util.StringTokenizer;
import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.inject.Named;
@@ -53,9 +52,7 @@
private static final String DATA_FILE_NAME = "data.sql";
@Inject
- private Instance<CodeFragmentManager> eaoIn;
- private CodeFragmentManager eao;
- private boolean secured;
+ private CodeFragmentManager codeFragmentManager;
private boolean populated;
@@ -67,8 +64,6 @@
return;
}
- eao = eaoIn.get();
-
try
{
String fileContent = readFileData(DATA_FILE_NAME);
@@ -89,9 +84,8 @@
st.nextToken();
c.setText(st.nextToken());
- eao.addCodeFragment(c, secured);
+ codeFragmentManager.addCodeFragment(c, false);
}
-
}
catch (Exception e)
{
@@ -106,14 +100,14 @@
InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
- String radek;
- StringBuffer sb = new StringBuffer();
+ String line;
+ StringBuilder sb = new StringBuilder();
- while ((radek = br.readLine()) != null)
+ while ((line = br.readLine()) != null)
{
- sb.append(radek).append("\n");
+ sb.append(line).append("\n");
}
- return new String(sb);
+ return sb.toString();
}
}