Questions tagged as 'java'

2
answers

Multithread and Data Competition + Spring

I am rewriting software that serves as a bridge between two services. Communication is done via sockets. The environment it has high data competition, especially a list with active sockets. The software has some problems because this competition...
asked by 28.11.2018 / 11:58
1
answer

QueryDSL with abstract class

I need to make a query that returns an abstract object. In case when my code arrives in the ".list ()" it throws an exception, on the other hand, if I use ".list" but returning an attribute of this object it works. I just want to know if quer...
asked by 05.02.2014 / 15:36
1
answer

Change the first and last element of an array by creating a new array

Why does the value of Numbers[0] change to 3 after executing the line of code below? New_Numbers [0] = Numbers [Numbers.length - 1]; The complete code: public static void main(String[] args) { System.out.print("Indique o número...
asked by 11.11.2018 / 18:24
1
answer

ERROR: Function to enter word in string

I wrote a function to receive a string, a character, and a position. /** * Funcao para inserir um simbolo em certa posicao valida ENTRE outros * em dada cadeia de caracteres. * @param a - cadeia de caracteres * @param b - cha...
asked by 12.11.2018 / 18:34
1
answer

Handling Invalid Characters Within a Switch

Hello, I have a code that registers people and performs some functions according to the option selected in the menu that opens at the beginning of the program, the options go from 1 to 7, the problem is that if I put any other character outside...
asked by 03.11.2018 / 18:09
1
answer

Get permission status when user has given runtime location access permission on Android

I'm picking up location data using LocationManager on Android and would like to know how I can get the action only if the user allows the app to access your data location. For example, using the code below, I can pick up according...
asked by 31.10.2018 / 00:51
1
answer

HTTP Status 400 - Bad Request - Spring MVC

When trying to call a Controller method it is returning the following error:    HTTP Status 400 - Bad Request Type Status Report       Description The server can not process the request due   something that is perceived to be a client error...
asked by 30.10.2018 / 20:43
2
answers

How to do a Select in a query

I'm wondering how to do a SELECT in my database. Here are the classes I use: DBHELPER public class DBHelper extends SQLiteOpenHelper { private static String NAME = "sqlitejuh.db"; private static int VERSION = 1; publi...
asked by 22.11.2018 / 21:34
1
answer

Firebase does not save data

So I'm having a problem and I can not solve it in order to study. I'm creating an already famous app and my doubt is the following when registering a user. Your name and email are not saved in the database. all the codes for this function: re...
asked by 24.12.2018 / 20:54
1
answer

JSON for POJO returning Null

I am making a request from the site API swapi and whenever I do the conversion from JSON to POJO, I get the NULL return RestTemplate restTemplate = new RestTemplate(); String fooResourceUrl = "https://swapi.co/api/planets/?format=json"; Plan...
asked by 25.12.2018 / 03:04