Guest User

Untitled

a guest
Oct 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. public interface IestoqueViewCadastroArmazem {
  2.  
  3. public static void run() {
  4.  
  5. while (true) {
  6. ArmazemBuilder armazem = new Armazem.ArmazemBuilder();
  7. System.out.println("Por favor, digite o nome do novo armazem:n");
  8. System.out.print("-> ");
  9.  
  10. armazem.armazem_Nome(Iscanner.nextLine()).build();
  11.  
  12. if (!armazem.build().getArmazem_Nome().isEmpty()) {
  13.  
  14. Estoque estoque = new Estoque();
  15. List<Estoque> estoqueList = EstoqueRules.listarRule(estoque);
  16. if (estoqueList.size() > 0) {
  17. while (true) {
  18. idEstoque = "";
  19. System.out
  20. .println("Por favor, digite a id de um estoque para este armazem, "
  21. + "deixe em branco para nenhum ou digite "
  22. + "LISTARESTOQUE para listar os estoques disponíveis:n");
  23. System.out.print("-> ");
  24.  
  25. if (boo == true) {
  26. armazem.estoque(Integer.parseInt(idEstoque));
  27. break;
  28. } else if (idEstoque.equalsIgnoreCase("LISTARESTOQUE")) {
  29. IimprimeListaConsole.imprimeListaConsole(estoqueList);
  30. } else if (idEstoque.isEmpty()) {
  31. break;
  32. }
  33. }
  34. } else {
  35. ArmazemRules.cadastrarRule(armazem.build());
  36. break;
  37. }
  38. break;
  39. } else {
  40. System.out.println("Campo em branco! digite o nome do armazem!");
  41. }
  42. }
  43. }
  44.  
  45. Exception in thread "main" java.lang.Error: Unresolved compilation problem:
  46. Local variable idEstoque defined in an enclosing scope must be final or effectively final
  47.  
  48. at viewTest.estoqueView.interfacesAction.IestoqueViewCadastroArmazem.<clinit>(IestoqueViewCadastroArmazem.java:36)
  49. at viewTest.estoqueView.IestoqueViewArmazem.menuEstoqueViewArmazem(IestoqueViewArmazem.java:17)
  50. at viewTest.estoqueView.IestoqueView.menuEstoqueView(IestoqueView.java:22)
  51. at viewTest.Main.main(Main.java:72)
Add Comment
Please, Sign In to add comment