• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

list return statement problem

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have the following bit of code in my repository class

i get an unreachable statement error code.. my question is how can i add a return statement for the type list?
 
Marshal
Posts: 76884
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't see any unreachable code; please supply the line numbers of the error message and of the code you have shown. I would expect a different compile‑time error from that code.
 
Georgios Adamidis
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:I can't see any unreachable code; please supply the line numbers of the error message and of the code you have shown. I would expect a different compile‑time error from that code.


this is my repository class code.. the error code pops up on line 31

 
Sheriff
Posts: 8544
615
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Georgios Adamidis wrote: the error code pops up on line 31


Line 31 is a curly brace, which seem to be a valid code. No, don't expect any errors on that line.

Can you just copy paste a full stack trace without adding any your interpretation.
 
Liutauras Vilda
Sheriff
Posts: 8544
615
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have replicated your scenario on my machine, all compiles.

But you have other problems, such as line 35. Check what's wrong with that.
 
Georgios Adamidis
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:I have replicated your scenario on my machine, all compiles.

But you have other problems, such as line 35. Check what's wrong with that.


whats the problem with that line?
 
Liutauras Vilda
Sheriff
Posts: 8544
615
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Georgios Adamidis wrote:

Liutauras Vilda wrote:I have replicated your scenario on my machine, all compiles.

But you have other problems, such as line 35. Check what's wrong with that.


whats the problem with that line?


It is related with comparing references versus actual content of the string.

I suggest you start writing tests, otherwise you may not succeed with this project. I think in other your threads I saw more problems.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic