Search Results

Search found 547 results on 22 pages for 'hashmap'.

Page 16/22 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Recursion Issue

    - by vishwanath katharki
    I am not able to populate the Map with the following recursive code. Can anybody help ?` public Map<String,JasperReport> getCompiledSubReports(JasperDesign jasperDesign, Map<String,JasperReport> hm) throws JRException{ if(hasSubReports(jasperDesign) && !allSubreportsProcessed(jasperDesign,hm)){ HashMap hashSet = getJasperDesignsForSubReports(jasperDesign); Set keySet = (Set) hashSet.keySet(); for(String s: keySet){ System.out.println(" Calling getCompiledSubReports " ); JasperDesign jsDesign = (JasperDesign) hashSet.get(s); if(hasSubReports(jsDesign) && !allSubreportsProcessed(jsDesign,hm)){ hm.putAll(getCompiledSubReports(jsDesign,hm)); } else{ JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); String nameParameter = getParameterByName(jasperDesign); if(nameParameter == null){ System.out.println(" No Name parameter! Cannot proceed !!!"); } hm.put(nameParameter,jasperReport); return hm; } } } return hm; }

    Read the article

  • luntbuild + maven + findbugs = OutOfMemoryException

    - by Johannes
    Hi, I've been trying to get Luntbuild to generate and publish a project site for our project including a Findbugs report. All other reports (Cobertura, Surefire, JavaDoc, Dashboard) work fine, but Findbugs bails out with an OutOfMemoryException. Excluding findbugs from report generation fixes the build --- although obviously without a Findbugs report. The funny thing is that I first encountered this problem locally and solved it by setting MAVEN_OPTS=-Xmx512m. This does not seem to be enough in Luntbuild, however: setting that exact same option as an environment variable of my builder doesn't make a difference. I've found a couple of posts on the 'net stating you should also add -XX:MaxPermSize=512m to MAVEN_OPTS and/or pass -Dmaven.findbugs.jvmargs=-Xmx512m to mvn.bat. None of these (or their combination) seem to help though so any hints would be greatly appreciated! Cheers, Johannes Relevant information: Luntbuild is 1.5.6, Maven is 2.1.0, findbugs-maven-plugin is 2.0.1. This is the Findbugs section of the relevant pom.xml: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.0.1</version> </plugin> This is the head of my build log: User "luntbuild" started the build Perform checkout operation for VCS setting: Vcs name: Subversion Repository url base: http://some.repository.com/repo/ Repository layout: multiple Directory for trunk: trunk Directory for branches: branches Directory for tags: tags Username: xxxx Password:xxxx Web interface: ViewVC URL to web interface: http://some.repository.com/repo/ Quiet period: modules: Source path: somepath, Branch: , Label: , Destination path: somewhere Source path: somepath, Branch: somewhere1.0.x, Label: , Destination path: somewhere-1.0.x Source path: somepath, Branch: somewhere1.1.x, Label: , Destination path: somewhere-1.1.x Update url: http://some.repository.com/repo//trunk Duration of the checkout operation: 0 minutes Perform build with builder setting: Builder name: default Builder type: Maven2 builder Command to run Maven2: "C:\maven\apache-maven-2.1.0\bin\mvn.bat" -e -f somewhere\pom.xml -P site -Dmaven.test.skip=false -DbuildDate="Tue Nov 24 11:13:24 CET 2009" -DbuildVersion="site-core138" -Dsvn.username=xxxx -Dsvn.password=xxxx -DstagingSiteURL=file:///C:/luntbuild/core-reports -Dmaven.findbugs.jvmargs=-Xmx512m Directory to run Maven2 in: Goals to build: site:stage site:stage-deploy Build properties: buildVersion="site-core138" artifactsDir="C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts" buildDate="Tue Nov 24 11:13:24 CET 2009" junitHtmlReportDir="" Environment variables: MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=512m" Build success condition: result==0 and builderLogContainsLine("INFO","BUILD SUCCESSFUL") Execute command: Executing 'C:\maven\apache-maven-2.1.0\bin\mvn.bat' with arguments: '-e' '-f' 'somewhere\pom.xml' '-P' 'site' '-Dmaven.test.skip=false' '-DbuildDate=Tue Nov 24 11:13:24 CET 2009' '-DbuildVersion=site-core138' '-Dsvn.username=xxxxxx' '-Dsvn.password=xxxxxx' '-DstagingSiteURL=file:///C:/luntbuild/reports' '-Dmaven.findbugs.jvmargs=-Xmx512m' '-DbuildVersion=site-core138' '-DartifactsDir=C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts' '-DbuildDate=Tue Nov 24 11:13:24 CET 2009' '-X' 'site:stage' 'site:stage-deploy' Tail of my build log: Analyzed: C:\luntbuild\somewhere-work\somewhere\...\SomeClass.class ... Analyzed: C:\luntbuild\somewhere-work\somewhere\...\target\classes Aux: C:\luntbuild\somewhere-work\somewhere\...\target\classes Aux: c:\maven\local-repo\...\somejar-1.1.1.1-SNAPSHOT.jar Aux: c:\maven\local-repo\commons-lang\commons-lang\2.3\commons-lang-2.3.jar .... Aux: c:\maven\local-repo\org\openoffice\ridl\3.1.0\ridl-3.1.0.jar Aux: c:\maven\local-repo\org\openoffice\unoil\3.1.0\unoil-3.1.0.jar [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [DEBUG] Trace java.lang.OutOfMemoryError: Java heap space at java.util.HashMap.(HashMap.java:209) at edu.umd.cs.findbugs.ba.type.TypeAnalysis$CachedExceptionSet.(TypeAnalysis.java:114) at edu.umd.cs.findbugs.ba.type.TypeAnalysis.getCachedExceptionSet(TypeAnalysis.java:688) at edu.umd.cs.findbugs.ba.type.TypeAnalysis.computeThrownExceptionTypes(TypeAnalysis.java:439) at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:411) at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:89) at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:356) at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:82) at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:44) at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331) at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281) at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:173) at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:64) at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331) at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281) at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:937) at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysisNoDataflowAnalysisException(ClassContext.java:921) at edu.umd.cs.findbugs.ba.ClassContext.getCFG(ClassContext.java:326) at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.analyzeMethod(BuildUnconditionalParamDerefDatabase.java:103) at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.considerMethod(BuildUnconditionalParamDerefDatabase.java:93) at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.visitClassContext(BuildUnconditionalParamDerefDatabase.java:79) at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:68) at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:971) at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:222) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756) [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17 minutes 16 seconds [INFO] Finished at: Tue Nov 24 11:31:23 CET 2009 [INFO] Final Memory: 70M/127M [INFO] ------------------------------------------------------------------------ Maven2 builder failed: build success condition not met! Note that apparently maven only uses 70MB... but that probably doesn't mean anything since the Findbugs plugin forks its own process.

    Read the article

  • Java Spam Filter

    - by JackSparrow
    I'm trying to create a spam filter in Java using the Bayesian algorithm. I use a text file that contains email messages and split the tokens using regex, storing these values into a hashmap. My problem is, with regex, the email addresses are split so instead of: [email protected] regex causes the token to be: john smith example The same holds true for ip addresses, so for example, instead of: 192.55.34.322 regex splits the tokens to be: 192 55 34 322 So does anybody know of a way that I could read the email messages and store their contents as is?

    Read the article

  • How to avoid encoding the key of request parameters being encoding

    - by fxp
    I'm trying to send a http request using WS.url() with a action receive a custom class parameter like public static void add(@Valid MyPage info) {...} There is a Map in MyPage @Required public Map<String, String> content = new HashMap<String, String>(); But When I try to send a request with WS.url().setParameter("info.content[name]","mynameis"); The action got no parameter and request's querystring convert info.content[name] into ...%5Bname%5D... I checked the WS.createQueryString and found it will encode all key and value. Any way to avoid that?

    Read the article

  • Rhino: How to get all properties from ScriptableObject?

    - by Dyatlov Vitaly
    Hi guys. I am using a Javascript object as an object with configuration properties. E.g. I have this object in javascript: var myProps = {prop1: 'prop1', prop2: 'prop2', 'prop3': 'prop3'}; This object (NativeObject) is returned to me in Java function. E.g. public Static void jsStaticFunction_test(NativeObject obj) { //work with object here } I want to get all properties from object and build HashMap from it. Any help will be appreciated.

    Read the article

  • How to Use Grizzly Embedded Server for Mule as Well as Jersey

    - by Tim
    I'm currently using JerseyTest w/ Grizzly embedded server to test some code. I do some very simple configuration to point it to the proper resources: Map<String, String> initParams = new HashMap<String, String>(); initParams.put("com.sun.jersey.config.property.packages", "com.sample.service"); ApplicationDescriptor appDescriptor = new ApplicationDescriptor(); appDescriptor.setServletInitParams(initParams); super.setupTestEnvironment(appDescriptor); This works fine and the Jersey components are available and working as expected. I'm now trying to add some Mule functionality to some of these Jersey calls, but Mule is not being properly initialized/configured by Grizzly. Has anyone gotten this kind of setup running? What additional configuration do I need to do with JerseyTest/GrizzlyWebServer to get it to initialize Mule properly?

    Read the article

  • Memory Profiling: How to detect which application/package is consuming too much memory

    - by malvim
    Hi, I have a situation here at work where we run a JEE server with several applications deployed on it. Lately, we've been having frequent OutOfMemoryException's. We suspect some of the apps might be behaving badly, maybe leaking, or something. The problem is, we can't really tell which one. We have run some memory profilers (like YourKit), and they're pretty good at telling what classes use the most memory. But they don't show relationships between classes, so that leaves us with a situation like this: We see that there are, say, lots of Strings and int arrays and HashMap entries, but we can't really tell which application or package they come from. Is there a way of knowing where these objects come from, so we can try to pinpoint the packages (or apps) that are allocating the most memory? Thank you in advance.

    Read the article

  • Unmarshalling collections in JaxB

    - by Stas
    Hi, suppose I have this class: public class A { private HashMap<String, B> map; @XmlElement private void setB(ArrayList<B> col) { ... } private ArrayList<B> getB() { ... } } When trying to unmarshall an xml document to this class using JaxB I notice that instead of calling the setB() method and sending me the list of B instances JaxB actually calls the getB() and adds the B instances to the returned list. Why? The reason I want the setter to be called is that the list is actually just a temporary storage from which I want to build the map field, so I thought to do it in the setter. Thanks.

    Read the article

  • Java: versioned data structures?

    - by Jason S
    I have a data structure that is pretty simple (basically a structure containing some arrays and single values), but I need to record the history of the data structure so that I can efficiently get the contents of the data structure at any point in time. Is there a relatively straightforward way to do this? The best way I can think of would be to encapsulate the whole data structure with something that handles all the mutating operations by storing data in functional data structures, and then for each mutation operation caching a copy of the data structure in a Map indexed by time-ordering (e.g. a TreeMap with real time as keys, or a HashMap with a counter of mutation operations combined with one or more indexes stored in TreeMaps mapping real time / tick count / etc. to mutation operations) any suggestions?

    Read the article

  • Error preparing statement in Jasper

    - by Augusto
    Hi, I'm trying to create a report with Jasper, but I keep getting this exception when running from my app (runs ok from IReport): net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query Here's the query I'm using: SELECT produtos.`Descricao` AS produtos_Descricao, saidas.`Quantidade` AS saidas_Quantidade, saidas.`Data` AS saidas_Data, motivossaidas.`Motivo` AS motivossaidas_Motivo FROM `produtos` produtos INNER JOIN `saidas` saidas ON produtos.`Id` = saidas.`Id_Produto` INNER JOIN `motivossaidas` motivossaidas ON saidas.`Id_MotivoSaida` = motivossaidas.`id` WHERE motivossaidas.`motivo` = $P{MOTIVO} and the parameter definition: <parameter name="MOTIVO" class="java.lang.String"/> The exception occurs when I do JasperPrint jasperPrint = JasperFillManager.fillReport(relatorio, parametros); where relatorio is a JasperReport object loaded with JRLoader.loadObject(URL) and parametros is a HashMap with the following key/values: REPORT_CONNECTION = MySQL JDBC connection, MOTIVO = "Venda" I really don't know what to do here. I keep getting the exception event if I use a query without any parameters. Why do I get this exception? What should I do here? Thanks!

    Read the article

  • Casting to generic type in Java doesn't raise ClassCastException?

    - by Kip
    I have come across a strange behavior of Java that seems like a bug. Is it? Casting an Object to a generic type (say, K) does not throw a ClassCastException even if the object is not an instance of K. Here is an example: import java.util.*; public final class Test { private static<K,V> void addToMap(Map<K,V> map, Object ... vals) { for(int i = 0; i < vals.length; i += 2) map.put((K)vals[i], (V)vals[i+1]); //Never throws ClassCastException! } public static void main(String[] args) { Map<String,Integer> m = new HashMap<String,Integer>(); addToMap(m, "hello", "world"); //No exception System.out.println(m.get("hello")); //Prints "world", which is NOT an Integer!! } }

    Read the article

  • GWT : Type of Container

    - by moorsu
    I see that there are two ways of transferring objects from server to client Use the same domain object (Contact.java) as used in the service layer. (I do not use hibernate) Use the HashMap to send the domain object field values in the form of Map with the help of BeanUtilsBean class. For multiple objects, use the List. Similary, use the Map to submit form values from client to server Is there any performance advantage for option 1 over 2?. Is there a way to hide the classname/package name that is sent to the browser if we use option 1?. thanks!.

    Read the article

  • JDT: How to retrieve the correct IJavaElement to a corresponding RefactoringDescriptor?

    - by Chris
    I implement the IRefactoringExecutionListener interface in an Eclipse plug-in to get notified when the user refactors his code, so I can update a visual editor displaying corresponding UML Boxes accordingly. Now I have a RefactoringDescriptor and cannot manage to map it's information (project name as String, new name as String and resource path as IPath) to my model. My model is basically a Hashmap in which fully qualified names (String) of types are mapped instances of IJavaElement, or more precisely: IType. How can I "convert" between the two representations so I can update my model? Regards, Chris

    Read the article

  • SoundPool repeating issue for Samsung Galaxy S3

    - by Alaa Eldin
    I'm trying to play a background sound for my application, I use SoundPool class, my problem is that, sound plays well only when I set the loop parameter with zero value, but it doesn't work for any other value. My code for initialization is: soundpool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0); soundsMap = new HashMap<Integer, Integer>(); soundsMap.put(1, soundpool.load(this, R.raw.soundfile_1, 1)); soundsMap.put(2, soundpool.load(this, R.raw.soundfile_2, 1)); my code for playing is soundpool.play(1, 0.9f, 0.9f, 1, -1, 1f); as I mentioned sound works when I put (0) instead of (-1) for the loop value, anyone has any idea why (-1) or any value other than (0) doesn't work (there is no output sound) ?

    Read the article

  • When is a scala partial function not a partial function?

    - by Fred Haslam
    While creating a map of String to partial functions I ran into unexpected behavior. When I create a partial function as a map element it works fine. When I allocate to a val it invokes instead. Trying to invoke the check generates an error. Is this expected? Am I doing something dumb? Comment out the check() to see the invocation. I am using scala 2.7.7 def PartialFunctionProblem() = { def dream()() = { println("~Dream~"); new Exception().printStackTrace() } val map = scala.collection.mutable.HashMap[String,()=>Unit]() map("dream") = dream() // partial function map("dream")() // invokes as expected val check = dream() // unexpected invocation check() // error: check of type Unit does not take parameters }

    Read the article

  • envets is not displayed on my fullcalendar

    - by ChangJiu
    Hi BalusC! I have used your method at above in my servelt. [CalendarMap] public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Map map = new HashMap(); map.put("id", 115); map.put("title", "changjiu"); map.put("start", new SimpleDateFormat("yyyy-MM-15").format(new Date())); map.put("url", "http://yahoo.com/"); // Convert to JSON string. String json = new Gson().toJson(map); // Write JSON string. response.setContentType("application/json"); response.setCharacterEncoding("UTF-8"); response.getWriter().write(json); } I want to display it my fullcalendar as follow. $(document).ready(function() { $('#calendar').fullCalendar({ eventSources: [ "CalendarMap" ] }); }); but it's not worked! Can you help me? thank you!

    Read the article

  • Cannot understand NullPointerException with custom adapter

    - by ganesh
    hi, I am trying to create a list view which as TextView that can display html content , an WebView and other basic TextViews.I tried to extend SimpleAdapter but i struck with the problem ,I will be glad if someone can point out the mistake i am doing. In onCreate method ArrayList mylist= resultfromXmlparser(); adap = new MyAdapter(TourLandingPage.this, mylist, R.layout.row, new String[] {"Name", "desc","Duration","Price","imgurl"}, new int[] {R.id.productname,R.id.des,R.id.duration,R.id.pricefrom,R.id.photo}); setListAdapter(adap); My custom Adapter looks like this private class MyAdapter extends SimpleAdapter { ArrayList<HashMap<String,String>> elements; Context ctx; public MyAdapter(Context context, ArrayList<HashMap<String,String>> mylist,int textViewResourceId,String[] names,int[] resouceid) { super(context, mylist,textViewResourceId, names,resouceid); this.elements=mylist; this.ctx=context; } @Override public int getCount() { return elements.size(); } @Override public Object getItem(int position) { return elements.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { RelativeLayout rowLayout; if (convertView == null) { rowLayout = (RelativeLayout) LayoutInflater.from(ctx).inflate(R.layout.rowfor_tourlist, parent, false); } else { rowLayout = (RelativeLayout) convertView; } TextView in = (TextView)rowLayout.findViewById(R.id.introduction); TextView du = (TextView)rowLayout.findViewById(R.id.duration); TextView pf = (TextView)rowLayout.findViewById(R.id.pricefrom); TextView pn = (TextView)rowLayout.findViewById(R.id.productname); WebView wv=(WebView)rowLayout.findViewById(R.id.photo); in.setText(Html.fromHtml(mylist.get(position).get("desc"))); du.setText(mylist.get(position).get("Duration")); pf.setText(mylist.get(position).get("Price")); pn.setText(mylist.get(position).get("Name")); wv.getSettings().setJavaScriptEnabled(true); wv.loadUrl(mylist.get(position).get("imgurl")); return convertView; } }//class and my row.xml file looks like RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" TextView android:id="@+id/productname" ...... LinearLayout android:layout_width="wrap_content" android:layout_height="60dip" android:layout_margin="5dip" android:layout_below="@id/productname" android:orientation="horizontal" android:id="@+id/lay1" WebView android:id="@+id/photo" .... TextView android:id="@+id/introduction" ...... LinearLayout TextView android:id="@+id/duration" .... TextView android:id="@+id/pricefrom" ..... RelativeLayout The error i was getting was 04-28 19:46:17.749: ERROR/AndroidRuntime(976): Uncaught handler: thread main exiting due to uncaught exception 04-28 19:46:17.769: ERROR/AndroidRuntime(976): java.lang.NullPointerException 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.ListView.setupChild(ListView.java:1693) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.ListView.makeAndAddView(ListView.java:1671) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.ListView.fillDown(ListView.java:637) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.ListView.fillFromTop(ListView.java:694) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.ListView.layoutChildren(ListView.java:1521) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.AbsListView.onLayout(AbsListView.java:1113) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.onLayout(LinearLayout.java:920) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.View.layout(View.java:6831) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.ViewRoot.performTraversals(ViewRoot.java:996) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.os.Handler.dispatchMessage(Handler.java:99) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.os.Looper.loop(Looper.java:123) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at android.app.ActivityThread.main(ActivityThread.java:4338) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at java.lang.reflect.Method.invokeNative(Native Method) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at java.lang.reflect.Method.invoke(Method.java:521) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 04-28 19:46:17.769: ERROR/AndroidRuntime(976): at dalvik.system.NativeStart.main(Native Method) 04-28 19:46:17.789: INFO/Process(52): Sending signal. PID: 976 SIG: 3 04-28 19:46:17.799: INFO/dalvikvm(976): threadid=7: reacting to signal 3 04-28 19:46:17.829: INFO/dalvikvm(976): Wrote stack trace to '/data/anr/traces.txt'

    Read the article

  • Paypal - DoExpressCheckoutPayment null pointer

    - by user969894
    String nvpstr = "&TOKEN=" + token + "&PAYERID=" + payerID + "&PAYMENTREQUEST_0_PAYMENTACTION=" + paymentType + "&PAYMENTREQUEST_0_AMT=" + finalPaymentAmount + "&PAYMENTREQUEST_0_CURRENCYCODE=" + currencyCodeType + "&IPADDRESS=" + serverName; Having done an earlier call to SetExpressCheckout, I had to change a few parameter names because Paypal had changed it in the documentation but not in the code from the integration wizard. Now for DoExpressCheckoutPayment I've modified a few but I get a null pointer at strAck: HashMap nvp = httpcall("DoExpressCheckoutPayment", nvpstr); String strAck = nvp.get("ACK").toString(); if (strAck.equalsIgnoreCase("Success")) { return nvp; } Not sure what is wrong, any suggestions for debugging this or possible solutions?

    Read the article

  • Searching through Collections in Java

    - by Click Upvote
    I have a java properties file containing a key/value pair of country names and codes. I will load the contents of this file into a Collection like List or HashMap. Then, I want users to be able to search for a country, e.g if they type 'Aus' in a textbox and click submit, then I want to search through the collection I have, containing a key/value pair of country codes/names (e.g AUS=Australia), and return those countries which are found matching. Is there any more efficient way of doing this, other than looping through the elements of the collection and using charAt()?

    Read the article

  • best practice for passing many arguments to method ?

    - by Tony
    Occasionally , we have to write methods that receive many many arguments , for example : public void doSomething(Object objA , Object objectB ,Date date1 ,Date date2 ,String str1 ,String str2 ) { } When I encounter this kind of problem , I often encapsulate arguments into a map. Map<Object,Object> params = new HashMap<Object,Object>(); params.put("objA",ObjA) ; ...... public void doSomething(Map<Object,Object> params) { // extracting params Object objA = (Object)params.get("objA"); ...... } This is not a good practice , encapsulate params into a map is totally a waste of efficiency. The good thing is , the clean signature , easy to add other params with fewest modification . what's the best practice for this kind of problem ?

    Read the article

  • Creating a triple store query using SQL - how to find all triples that have a common predicate and o

    - by Ankur
    I have a database that acts like a triple store, except that it is just a simple MySQL database. I want to select all triples that have a common predicate and object. Info about RDF and triples I can't seem to work out the SQL. If I had just a single predicate and object to match I would do: select TRIPLE from TRIPLES where PREDICATE="predicateName" and OBJECT="objectName" But if I have a list (HashMap) of many pairs of (predicateName,objectName) I am not sure what I need to do. Please let me know if I need to provide more info, I am not sure that I have made this quite clear, but I am wary of providing too much info and confusing the issue.

    Read the article

  • The best way to assign an immutable instance to a Collection in Java

    - by Ali
    Today I was reading through some Hibernate code and I encounter something interesting. There is a class called CollectionHelper that defines the following constant varibale: public final class CollectionHelper { public static final List EMPTY_LIST = Collections.unmodifiableList( new ArrayList(0 ) ; public static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection(new ArrayList(0) ); public static final Map EMPTY_MAP = Collections.unmodifiableMap( new HashMap(0) ); They have used these constants to initialize collections with immutable instances. Why they didn't simply use the Collections.EMPTY_LIST for initializing lists? Is there a benefit in using the following method?

    Read the article

  • Close resources before exiting JFrame and TCP communication in Java

    - by Oz Molaim
    1. I'm writing a chat based application on TCP communication. I'm using NetBeans and I want to add functionality to the default EXIT_ON_CLOSE when exiting JFrame. The reason of course is because I want to clean resources and end threads safely. How can I call a method that clear resources and only then close the JFrame safely and end the process. 2. I need to implement the server side. The server has List/HashMap/Queue of 'Socket' with their chat nick-names. Is there any simple design pattern to do it correctly because I don't want to re-invent the wheel. thanks.

    Read the article

  • How to sort a key of a map

    - by Tsuna Sawada
    How to sort (any kind of sorting) a key of a map(treemap or hashmap) i have a problem and it goes like this. i have a map that has a key of 27527-683, 27525-1179, 27525-1571, 27525-1813, 27525-4911, 27526-1303, 27526-3641, 27525-3989, 27525-4083, 27525-4670, 27526-4102, 27526-558, 27527-2411, 27527-4342 this is the list of keys and the value for each of the key is a list. now, how can i sort this key in ascending order by number. ex. if i want to sort : 1,2,11,20,31,3,10 i want to have as output is : 1,2,3,10,11,20,31 but when i use the autosort of treemap the output goes : 1,10,11,2,20,3,31 how can i sort it in ascending order by numeric? please help me. i can't think of anymore ways because this is my first time handling map and list

    Read the article

  • Under what circumstances does Groovy use AbstractConcurrentMap?

    - by Electrons_Ahoy
    (Specifically, org.codehaus.groovy.util.AbstractConcurrentMap) While doing some profiling of our application thats mixed Java/Groovy, I'm seeing a lot of references to the AbstractConcurrentMap class, none of which are explicit in the code base. Does groovy use this class when maps are instantiated in the groovy dynamic def myMap = [:] style? Are there rules somewhere about when groovy chooses to use this as opposed to, say, java.util.HashMap? And does anyone have any performance information comparing the two? My rough "eyeball check" says that AbstractConcurrentMap seems to be much slower - anyone know if I'm right?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22  | Next Page >