[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| 
Re: [jts-dev] Simple cast problem
 | 
  
  
    I'm using Eclipse.
    Version: 2021-06 (4.20.0)
      Build id: 20210612-2011
    
    Running using....
    
    C:\Users\Simon\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_16.0.2.v20210721-1149\jre
    
    I am compiling using 1.. 
    and running under 1.8.0_291.
    I am using jts-core-1.16.1.jar
    
    Simon
    
    On 13/02/2024 2:50 am, Jody Garnett
      wrote:
    
    
      
      That sounds very odd, try stepping through the
        code with a debugger…
      
      
      I should also ask what version of Java you are
        using and if you are in an environment like OSGi that uses class
        loaders or a module system to isolate; it would be awkward if
        you had two versions of JTS in play. 
      
      
      
      
        
          
          
            In my Java code I create a Geometry object
              that could be of any type.
              
            
            I test that the Geometry us if type Polygon
              then do a cast. My code terminates with no exception
              thrown....
              
            
            Geometry g = ......;
            
            if ( g instanceof Polygon) {
            
               Polygon p = (Polygon) g;
            
               //Process polygon
            
            }
              
            
            Any help trying to work out what is going on
              appreciated.
              
            
            Simon
              
            
            39 Cliff View Drive, Allens Rivulet, 7150,
              Tasmania, Australia
            
            (P) 03 62 396 397
            
            (M) 0418 396 381
            
            
            _______________________________________________
            jts-dev mailing list
            jts-dev@xxxxxxxxxxx
            To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jts-dev
          
         
       
    
    -- 
Simon Greener
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia
(m) +61 418 396 391
(w) www.spdba.com.au
(m) simon@xxxxxxxxxxxx