IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Collection et Stream Java Discussion :

Problème de ConcurrentModificationException


Sujet :

Collection et Stream Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Juillet 2004
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 42
    Par défaut Problème de ConcurrentModificationException
    hello,

    j'ai un souci de concurrentModificationException. J'ai bien compris que je n'étais pas sensé modifier une liste pendant que je la parcours, mais là je ne comprends pas je n'ai pas l'impression de le faire...
    Voilà le bout de code qui me pose problème :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
         private Triangle update (Sommet site, Set<Triangle> cavity) {
            Set<Set<Sommet>> boundary = new HashSet<Set<Sommet>>();
            Set<Triangle> theTriangles = new HashSet<Triangle>();
            // Find boundary facets and adjacent triangles
            for (Triangle triangle: cavity) {
                theTriangles.addAll(triangle.getVoisins());
                for (Sommet sommet: triangle.getSommets()) {
                    Set<Sommet> facet = triangle.facetOpposite(sommet);
                    if (boundary.contains(facet)) boundary.remove(facet);
                    else boundary.add(facet);
                }
            }
    Sachant que les méthodes getSommet et facetOpposite ne sont que des getters, et ne touchent à rien... Est-ce qu'il y a un souci là dedans ?

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    68
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 68
    Par défaut
    bonjour
    peut-etre sur boundary, c'est quoi comme Objet? le compilo t'indique la ligne où il y a le boundary ou c'est une autre?

  3. #3
    Membre averti
    Inscrit en
    Juillet 2004
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 42
    Par défaut
    bonsoir,

    j'ai édité mon premier message pour mettre le début de la méthode, où on définit boundary. Le compilateur ne m'indique pas d'erreur, c'est à l’exécution que j'ai un problème. La ligne qui pose problème est
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    for (Sommet sommet: triangle.getSommets()) {

  4. #4
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Humm. Pas évident.

    Toutes ces Collections doivent être interliées d'une manière ou d'une autre, mais je n'arrive pas à imaginer comment à partir de ce code. Tu montrerais la classe Triangle ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  5. #5
    Membre averti
    Inscrit en
    Juillet 2004
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 42
    Par défaut
    Voilà la classe triangle :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    package metier;
    import java.awt.Polygon;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
     
    /**
     * Les triangles sont réputés être orientés, c'est à dire en appelant ABC les trois 
     * sommets, on a ABC > 0  
     *
     */
     
    public class Triangle{
    	private List<Sommet> sommets ;
    	private Triangle voisin0 ;
    	private Triangle voisin1 ;
    	private Triangle voisin2 ;
    	private Sommet centreCercleCirconscrit;
     
    	public Triangle(Sommet sommet1,Sommet sommet2,Sommet sommet3) {
    		sommets = new ArrayList<Sommet>();
    		sommets.add(sommet1) ;
    		sommets.add(sommet2) ;
    		sommets.add(sommet3) ;
    		assert this.isOriente();
    	}
     
     
    	public Triangle(Set<Sommet> vertices) {
    		assert vertices.size()==3 ;
    		sommets = (List<Sommet>) vertices ;
    	}
     
     
     
     
     
    	/**
     
             * Renvoie le côté opposé d'un sommet du triangle, renvoie null
     
             * s'il n'y en a pas
     
             * @param vertex
     
             * @return
     
             */
     
    	public Set<Sommet> facetOpposite(Sommet vertex) {
     
    		assert getSommets().contains(vertex);
     
    		List<Sommet> liste = getSommets() ;
     
    		for (Sommet sommet : getSommets()) {
     
    			if (sommet.equals(vertex)){
     
    				liste.remove(sommet);
     
    				return new HashSet<Sommet>(liste) ;
     
    			}
     
    		}
     
    		return null ;
     
    	}
     
     
     
    	public Collection<? extends Triangle> getVoisins() {
     
    		List<Triangle> voisins = new ArrayList<Triangle>();
     
    		voisins.add(voisin0);
     
    		voisins.add(voisin1);
     
    		voisins.add(voisin2);
     
    		return voisins;
     
    	}
     
     
     
    	public boolean isRealTriangle() {
     
    		if (sommets.get(0).equals(sommets.get(1))||
     
    		sommets.get(1).equals(sommets.get(2))||
     
    		sommets.get(2).equals(sommets.get(0))) {
     
    			return false ;
     
    		} else {
     
    			return true ;
     
    		}
     
    	}
     
     
     
    	public Sommet getCentreCercleCirconscrit() {
     
    		if (centreCercleCirconscrit==null){
     
    			centreCercleCirconscrit=calculCentreCirconscrit(this) ;
     
    		}
     
    		return centreCercleCirconscrit ;
     
    	}
     
     
     
    	public Sommet calculCentreCirconscrit(Triangle triangle) {
     
    		DroiteCartesienne mediatrice1, mediatrice2 ;
     
    		mediatrice1 = DroiteCartesienne.mediatrice(triangle.getSommets().get(0), triangle.getSommets().get(1));
     
    		mediatrice2 = DroiteCartesienne.mediatrice(triangle.getSommets().get(1), triangle.getSommets().get(2));
     
    		return mediatrice1.intersection(mediatrice2);
     
    	}
     
     
     
    	public List<Integer> sommetsCommuns(Triangle tri){
     
    		assert tri.isRealTriangle() ;
     
    		assert this.isRealTriangle() ;
     
    		List<Integer> result = new ArrayList<Integer>();
     
    		for (int i = 0; i < 3; i++) {
     
    			for (int j = 0; j < 3 ; j++) {
     
    				if (this.getSommets().get(i).equals(tri.getSommets().get(j))){
     
    					result.add(i);
     
    				}
     
    			}
     
    		}
     
    		return result ;
     
    	}
     
     
     
    	public List<Integer> sommetsDisjoints(Triangle tri){
     
    		assert tri.isRealTriangle() ;
     
    		assert this.isRealTriangle() ;
     
    		List<Integer> result = new ArrayList<Integer>();
     
    		boolean ajout ;
     
    		for (int i = 0; i < 3; i++) {
     
    			ajout = true ;
     
    			for (int j = 0; j < 3 ; j++) {
     
    				if (this.getSommets().get(i).equals(tri.getSommets().get(j))){
     
    					ajout=false ;
     
    				}
     
    			}
     
    			if (ajout) {result.add(i) ; }
     
    		}
     
    		return result ;
     
    	}
     
     
     
    	public List<Sommet> getSommets() {
     
    		return sommets;
     
    	}
     
    	public void setSommets(List<Sommet> sommets) {
     
    		this.sommets = sommets;
     
    	}
     
     
     
    	public String toString(){
     
    		if (this==null) {
     
    			return "null";
     
    		} else {
     
    			return "sommets : " +  this.sommets.get(0) + this.sommets.get(1) + 
     
    			this.sommets.get(2) ; 
     
    		}
     
    	}
     
     
     
     
     
    	/**
     
             * Teste si le triangle est orienté
     
             * @return
     
             */
     
    	public boolean isOriente() {
     
    		if ((Principal.signeAngle(sommets.get(0), sommets.get(1), sommets.get(2)) > 0)) {
     
    				return true ;
     
    		} else {
     
    			return false ;
     
    		}
     
    	}
     
    	public boolean isPlat() {
     
    		DroiteCartesienne d1 = new DroiteCartesienne(sommets.get(0), sommets.get(1));
     
    		if (d1.isSurlaDroite(sommets.get(2))){
     
    			return true ;
     
    		} else {
     
    			return false;
     
    		}
     
    	}
     
    	/**
     
             * s est un point qui appartient au triangle. cette méthode renvoie l'indice du sommet face au côté qui contient le sommet
     
             * @param s
     
             * @return
     
             */
     
    	public int pointSurCote(Sommet s) {
     
    		assert !(s == null );
     
    		assert !sommets.get(0).equals(s) ;
     
    		assert !sommets.get(1).equals(s) ;
     
    		assert !sommets.get(2).equals(s) ;
     
    		if (Principal.signeAngle(sommets.get(0), sommets.get(1), s) == 0 ) {
     
    			return 2 ;
     
    		} else {
     
    			if (Principal.signeAngle(sommets.get(1),sommets.get(2),s) == 0 ){
     
    				return 0 ;
     
    			} else {
     
    				return 1 ;
     
    			}
     
    		}
     
    	}
     
     
     
    	/**
     
             * Remplace le voisin voisinOld par le triangle voisinNew dans la liste des voisin
     
             * @param voisinOld
     
             * @param voisinNew
     
             */
     
    	public void remplacerVoisin(Triangle voisinOld,Triangle voisinNew){
     
    		assert voisinOld != null ;
     
    		assert voisinNew != null ;
     
    		if (voisin0!=null){
     
    			if (voisin0.equals(voisinOld)){
     
    				voisin0 = voisinNew ;
     
    			}
     
    		}
     
    		if (voisin1!=null){
     
    			if (voisin1.equals(voisinOld)){
     
    				voisin1 = voisinNew ;
     
    			}
     
    		}
     
    		if (voisin2!=null){
     
    			if (voisin2.equals(voisinOld)){
     
    				voisin2 = voisinNew ;
     
    			}
     
    		}
     
    	}
     
     
     
    	public Triangle getVoisin0() {
     
    		return voisin0;
     
    	}
     
     
     
    	public void setVoisin0(Triangle voisin0) {
     
    		this.voisin0 = voisin0;
     
    	}
     
     
     
    	public Triangle getVoisin1() {
     
    		return voisin1;
     
    	}
     
     
     
    	public void setVoisin1(Triangle voisin1) {
     
    		this.voisin1 = voisin1;
     
    	}
     
     
     
    	public Triangle getVoisin2() {
     
    		return voisin2;
     
    	}
     
     
     
    	public void setVoisin2(Triangle voisin2) {
     
    		this.voisin2 = voisin2;
     
    	}
     
     
     
    	/**
     
             * Set le voisin voisin à la place indice
     
             * @param voisin
     
             * @param indice
     
             */
     
    	public void setVoisin(Triangle voisin,int indice){
     
    		assert indice > -1 ;
     
    		assert indice < 3 ;
     
    		if (indice==0){
     
    			setVoisin0(voisin);
     
    		}else {
     
    			if (indice==1){
     
    				setVoisin1(voisin);
     
    			}else{
     
    				if (indice==2){
     
    					setVoisin2(voisin);
     
    				}
     
    			}
     
    		}
     
    	}
     
     
     
    	public boolean equals(Object o){
     
    		Triangle t = (Triangle) o ;
     
    		if (t.getSommets().get(0).equals(getSommets().get(0)) &&
     
    			t.getSommets().get(1).equals(getSommets().get(1)) &&
     
    			t.getSommets().get(2).equals(getSommets().get(2))){
     
    			return true ;
     
    		}else {
     
    			if (t.getSommets().get(0).equals(getSommets().get(1)) &&
     
    					t.getSommets().get(1).equals(getSommets().get(2)) &&
     
    					t.getSommets().get(2).equals(getSommets().get(0))){
     
    					return true ;
     
    				}else {
     
    					if (t.getSommets().get(0).equals(getSommets().get(2)) &&
     
    							t.getSommets().get(1).equals(getSommets().get(0)) &&
     
    							t.getSommets().get(2).equals(getSommets().get(1))){
     
    							return true ;
     
    						}else {
     
    							return false ;
     
    						}
     
    				}
     
    		}
     
    	}
     
     
     
    	public Triangle getVoisin(int indice) {
     
    		assert indice > -1 ;
     
    		assert indice < 3 ;
     
    		if (indice==0){
     
    			return voisin0 ;
     
    		}else {
     
    			if (indice==1){
     
    				return voisin1 ;
     
    			}else {
     
    				return voisin2 ;
     
    			}
     
    		}
     
    	}
     
     
     
    	public Polygon toPolygon(){
     
    		int tableauX[] = new int[3] ; 
     
    		int tableauY[] = new int[3];
     
    		tableauX[0]=(int) sommets.get(0).getX();
     
    		tableauX[1]=(int) sommets.get(1).getX();
     
    		tableauX[2]=(int) sommets.get(2).getX();
     
    		tableauY[0]=(int) sommets.get(0).getY();
     
    		tableauY[1]=(int) sommets.get(1).getY();
     
    		tableauY[2]=(int) sommets.get(2).getY();
     
    		return new Polygon(tableauX, tableauY, 3);
     
    	}
     
     
     
    	/**
     
             * Indique si le cercle circonscrit au triangle contient ou non le sommet s. 
     
             * vaut 1 si oui, -1 si non, 0 si le point est sur le cercle
     
             * @param s
     
             * @return
     
             */
     
    	public int cercleCirconscritContientSommet(Sommet s){
     
    		assert s != null ;
     
    		if (s.distance(getCentreCercleCirconscrit()) < getCentreCercleCirconscrit().distance(sommets.get(0))){
     
    			return 1 ;
     
    		}else {
     
    			if (s.distance(getCentreCercleCirconscrit()) > getCentreCercleCirconscrit().distance(sommets.get(0))){
     
    			return -1 ;}
     
    			else {
     
    				return 0 ;
     
    			}
     
    		}
     
    	}
     
     
     
    	public boolean isVoisin(Triangle other) {
     
    		int i = 0 ;
     
    		for (Sommet sommet : getSommets()) {
     
    			if (other.getSommets().contains(sommet)) i++ ;
     
    		}
     
    		return (i==2);
     
    	}
     
     
     
    }
    Pour plus de lisibilité j'ai viré les méthodes qui me semblait rajouter du bruit, mais si quelqu'un préfère tous le code pas de problème.

    edit : suppression des sauts de ligne inutiles
    edit : rajout de toute la classe

  6. #6
    Membre actif
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    68
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 68
    Par défaut
    Bonjour
    oui je crois que tu devrais poster le reste du code, ainsi que le message d'exception exact

    mais dejà je comprends pas pourquoi tu déclares un "Collection<? extends Triangle>" comme retour de ta methode getVoisins(), alors que c'est un List dans le corps

  7. #7
    Membre averti
    Inscrit en
    Juillet 2004
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 42
    Par défaut
    J'ai rajouté la totalité de la classe Triangle. Pour que ce soit plus clair, mon algo essaye de faire une triangulation de delaunay à partir d'une liste de sommets. Je mets ici la totalité de ma classe principal :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    package metier;
     
    import java.util.ArrayList;
     
    import java.util.HashSet;
     
    import java.util.Iterator;
     
    import java.util.LinkedList;
     
    import java.util.List;
     
    import java.util.Queue;
     
    import java.util.Set;
     
     
     
     
     
    public class Principal {
     
    	private Graph<Triangle> liste  = new Graph<Triangle>();
     
    	private Set<Sommet> listeS = new HashSet<Sommet>();
     
     
     
    	public Principal(Set<Sommet> listeSommet) {
     
    		this.listeS = listeSommet ;
     
    		double[] listeX = new double[listeS.size()] ;
     
    		double[] listeY = new double[listeS.size()] ;
     
    		int i = 0 ;
     
    		for (Sommet sommet : listeS) {
     
    			listeX[i]=sommet.getX();
     
    			listeY[i]=sommet.getY();
     
    			i++ ;
     
    		}
     
    		double minx = trouverMin(listeX) ;
     
    		double miny = trouverMin(listeY) ;
     
    		double maxx = trouverMax(listeX) ;
     
    		double maxy = trouverMax(listeY) ;
     
    		Sommet sommet1 = new Sommet(minx-10,miny-10);
     
    		Sommet sommet2 = new Sommet(minx-10,maxy+maxx-minx+10);
     
    		Sommet sommet3= new Sommet(maxx+maxy-miny+10,miny);
     
    		Triangle triangle1 = new Triangle(sommet1,sommet2,sommet3);
     
    		assert triangle1.isOriente();
     
    		liste.add(triangle1);
     
    		insererListe();
     
    		enleverTriangleContenant(sommet1);
     
    		enleverTriangleContenant(sommet2);
     
    		enleverTriangleContenant(sommet3);
     
    	}
     
     
     
    	private void enleverTriangleContenant(Sommet s){
     
    		for (Triangle tri : liste.nodeSet()) {
     
    			if (tri.getSommets().contains(s)){
     
    				liste.remove(tri);
     
    			}
     
    		}
     
    	}
     
     
     
     
     
    	private void insererListe(){
     
    		assert listeS.size() > 0 ;
     
    		for (Sommet sommet : listeS) {
     
    			System.out.println("insertion de " + sommet);
     
    			Set<Triangle> cave = getCavity(sommet, triangleContenantPoint(sommet));
     
    			update(sommet, cave);
     
    		}
     
    	}
     
     
     
        /**
     
         * Determine the cavity caused by site.
     
         * @author Paul Chew
     
         * @param site the site causing the cavity
     
         * @param triangle the triangle containing site
     
         * @return set of all triangles that have site in their circumcircle
     
         */
     
        private Set<Triangle> getCavity (Sommet site, Triangle triangle) {
     
            Set<Triangle> cavite = new HashSet<Triangle>();
     
            Queue<Triangle> toBeChecked = new LinkedList<Triangle>();
     
            Set<Triangle> marked = new HashSet<Triangle>();
     
            toBeChecked.add(triangle);
     
            marked.add(triangle);
     
            while (!toBeChecked.isEmpty()) { 	
     
            	triangle = toBeChecked.remove();
     
                if (site.isInCercleCirconscrit(triangle) == -1)
     
                    continue; // Site outside triangle => triangle not in cavity
     
                cavite.add(triangle);
     
                // Check the neighbors
     
                for (Triangle voisin : liste.neighbors(triangle)) {
     
    				if (marked.contains(voisin)) continue ;
     
    				marked.add(voisin);
     
    				toBeChecked.add(voisin);
     
    			}
     
            }
     
            return cavite;
     
        }
     
     
     
     
     
        /**
     
         * Update the triangulation by removing the cavity triangles and then
     
         * filling the cavity with new triangles.
     
         * @author Paul Chew
     
         * @param site the site that created the cavity
     
         * @param cavity the triangles with site in their circumcircle
     
         * @return one of the new triangles
     
         */
     
        private Triangle update (Sommet site, Set<Triangle> cavity) {
     
            Set<Set<Sommet>> boundary = new HashSet<Set<Sommet>>();
     
            Set<Triangle> theTriangles = new HashSet<Triangle>();
     
     
     
            // Find boundary facets and adjacent triangles
     
            for (Triangle triangle: cavity) {
     
                theTriangles.addAll(triangle.getVoisins());
     
                System.out.println(triangle.getSommets());
     
                for (Sommet sommet: triangle.getSommets()) {
     
                    Set<Sommet> facet = triangle.facetOpposite(sommet);
     
                    if (boundary.contains(facet)) boundary.remove(facet);
     
                    else boundary.add(facet);
     
                }
     
            }
     
            theTriangles.removeAll(cavity);        // Adj triangles only
     
     
     
            // Remove the cavity triangles from the triangulation
     
            for (Triangle triangle: cavity) liste.remove(triangle);
     
     
     
            // Build each new triangle and add it to the triangulation
     
            Set<Triangle> newTriangles = new HashSet<Triangle>();
     
            for (Set<Sommet> vertices: boundary) {
     
                vertices.add(site);
     
                Triangle tri = new Triangle(vertices);
     
                liste.add(tri);
     
                newTriangles.add(tri);
     
            }
     
     
     
            // Update the graph links for each new triangle
     
            theTriangles.addAll(newTriangles);    // Adj triangle + new triangles
     
            for (Triangle triangle: newTriangles)
     
                for (Triangle other: theTriangles)
     
                    if (triangle.isVoisin(other))
     
                        liste.add(triangle, other);
     
     
     
            // Return one of the new triangles
     
            return newTriangles.iterator().next();
     
        }
     
     
     
    	/**
     
             * renvoie l'indice correspondant au triangle contenant le point. Renvoie null s'il n'y en a pas.
     
             * @param point
     
             * @return
     
             */
     
    	private Triangle triangleContenantPoint(Sommet point){
     
    		assert point != null ;
     
    		Triangle result = null ;
     
    		for (Triangle tri : liste.nodeSet()) {
     
    			if (isInTriangle(tri, point)!=0){
     
    				result = tri ; break ;
     
    			}
     
    		}
     
    		return result ;
     
    	}
     
     
     
     
     
    	/**
     
             * Détermine si le Sommet point est dans le Triangle triangle. renvoie 0 si le point n'est pas dans le triangle
     
             * 1 s'il est dans le triangle, -1 s'il est sur le triangle.
     
             * @param triangle
     
             * @param point
     
             * @return
     
             */
     
    	private static int isInTriangle(Triangle triangle, Sommet point){
     
    		assert triangle != null ;
     
    		assert point != null ;
     
    		assert triangle.isRealTriangle() : "les trois points du triangle sont confondus";
     
    		assert triangle.isOriente() : "le triangle n'est pas orienté " + triangle;
     
    		int angleA = signeAngle(triangle.getSommets().get(1),triangle.getSommets().get(0),point) ;
     
    		int angleB = signeAngle(triangle.getSommets().get(2),triangle.getSommets().get(1),point);
     
    		int angleC = signeAngle(triangle.getSommets().get(0),triangle.getSommets().get(2),point);
     
    		if ( angleA > 0) {
     
    			return 0 ;
     
    		} else {
     
    			if ( angleB > 0){
     
    				return 0 ;
     
    			} else {
     
    				if ( angleC > 0){
     
    					return 0 ;
     
    				} else {
     
    					if (angleA*angleB*angleC == 0) {
     
    						return -1 ;
     
    					} else {
     
    						return 1 ;
     
    					}
     
    				}
     
    			}
     
    		}
     
    	}
     
    	/**
     
             * Renvoie le signe de l'angle AOB. 
     
             * @param a sommet A
     
             * @param o sommet B
     
             * @param b sommet C
     
             * @return signe de l'angle AOB. Renvoie 0 si l'angle est nul, 1 s'il est positif, -1 s'il est négatif
     
             */
     
    	public static int signeAngle(Sommet a, Sommet o,Sommet b){
     
    		assert a != null ;
     
    		assert o != null ;
     
    		assert b != null ;
     
    		//calcul des coordonnées des vecteurs
     
    		double xoa = a.getX() - o.getX() ;
     
    		double yoa = a.getY() - o.getY();
     
    		double xob = b.getX() - o.getX();
     
    		double yob = b.getY() - o.getY();
     
    		double det = xoa*yob-xob*yoa ;
     
    		if (det>0) {
     
    			return 1 ;
     
    		} else {
     
    			if (det < 0) {
     
    				return -1 ;
     
    			}else {
     
    				return 0 ;
     
    			}
     
    		}
     
    	}
     
     
     
    	public Graph<Triangle> getListeTriangle() {
     
    		return liste ;
     
    	}
     
     
     
    	public double trouverMin(double[] l){
     
    		double min = l[0];
     
    		for (int i = 0; i < l.length; i++) {
     
    			if (l[i] < min) {
     
    				min = l[i] ;
     
    			}
     
    		} 
     
    		return min ;
     
    	}
     
     
     
    	public double trouverMax(double[] l){
     
    		double max = l[0];
     
    		for (int i = 0; i < l.length; i++) {
     
    			if (l[i] > max) {
     
    				max = l[i] ;
     
    			}
     
    		} 
     
    		return max ;
     
    	}
     
    }
    ainsi que mes autres classes, voilà sommet :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    package metier;
     
    public class Sommet {
     
    	private double x ;
    	private double y ;
    	public double getX() {
    		return x;
    	}
    	public void setX(int x) {
    		this.x = x;
    	}
    	public double getY() {
    		return y;
    	}
    	public void setY(int y) {
    		this.y = y;
    	}
     
    	public Sommet(double x, double y) {
    		this.x = x;
    		this.y = y;
    	}	
     
    	public boolean equals(Object o){
    		Sommet s = (Sommet) o ;
    		if (s.getX()==x){
    			if (s.getY()==y){
    				return true ;
    			}
    			else {
    				return false ;
    			}
    		}else {
    			return false ;
    		}
    	}
     
    	public double distance(Sommet s){
    		return  (double) Math.sqrt((s.getX()-this.getX())*(s.getX()-this.getX())+(s.getY()-this.getY())*(s.getY()-this.getY()));
    	}
     
    	public String toString(){
    		return "("+x + "," + y + ") ";
    	}
     
    	/**
             * Renvoie vrai si le sommet s est plus grand que le sommet courant.
             * Plus grand s'entend : on classe les éléments selon l'abscisse, puis
             * selon l'ordonnée en cas d'égalité. Si les ordonnées sont également égales,
             * par convention on renvoie false.
             * @param s
             * @return
             */
    	public boolean inferieurA(Sommet s){
    		if (s.getX()> getX()){
    			return true ;
    		}else {
    			if (s.getX() < getX()){
    				return false ;
    			}else {
    				if (s.getY() > getY()){
    					return true ;
    				}else {
    					return false ;
    				}
    			}
    		}
    	}
     
    	/**
             * Test si le point est dans le cercle circonscrit au triangle t
             * vaut 1 si oui, -1 si non et 0 si le point est sur le cercle
             * @param t
             * @return
             */
    	public int isInCercleCirconscrit(Triangle t){
    		assert t != null ;
    		return t.cercleCirconscritContientSommet(this) ;
    	}
    }
    Voilà Graph :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    package metier;
     
     
     
    /*
     
     * Copyright (c) 2007 by L. Paul Chew.
     
     *
     
     * Permission is hereby granted, without written agreement and without
     
     * license or royalty fees, to use, copy, modify, and distribute this
     
     * software and its documentation for any purpose, subject to the following
     
     * conditions:
     
     *
     
     * The above copyright notice and this permission notice shall be included
     
     * in all copies or substantial portions of the Software.
     
     *
     
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     
     * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     
     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     
     * DEALINGS IN THE SOFTWARE.
     
     */
     
     
     
    import java.util.Collections;
     
    import java.util.HashMap;
     
    import java.util.Map;
     
    import java.util.Set;
     
     
     
    /**
     
     * Straightforward undirected graph implementation.
     
     * Nodes are generic type N.
     
     *
     
     * @author Paul Chew
     
     *
     
     * Created November, December 2007.  For use in Delaunay/Voronoi code.
     
     *
     
     */
     
    public class Graph<N> {
     
     
     
        private Map<N, Set<N>> theNeighbors =    // Node -> adjacent nodes
     
            new HashMap<N, Set<N>>();
     
        private Set<N> theNodeSet =              // Set view of all nodes
     
            Collections.unmodifiableSet(theNeighbors.keySet());
     
     
     
        /**
     
         * Add a node.  If node is already in graph then no change.
     
         * @param node the node to add
     
         */
     
        public void add (N node) {
     
            if (theNeighbors.containsKey(node)) return;
     
            theNeighbors.put(node, new ArraySet<N>());
     
         }
     
     
     
        /**
     
         * Add a link. If the link is already in graph then no change.
     
         * @param nodeA one end of the link
     
         * @param nodeB the other end of the link
     
         * @throws NullPointerException if either endpoint is not in graph
     
         */
     
        public void add (N nodeA, N nodeB) throws NullPointerException {
     
            theNeighbors.get(nodeA).add(nodeB);
     
            theNeighbors.get(nodeB).add(nodeA);
     
        }
     
     
     
        /**
     
         * Remove node and any links that use node. If node not in graph, nothing
     
         * happens.
     
         * @param node the node to remove.
     
         */
     
        public void remove (N node) {
     
            if (!theNeighbors.containsKey(node)) return;
     
            for (N neighbor: theNeighbors.get(node))
     
                theNeighbors.get(neighbor).remove(node);    // Remove "to" links
     
            theNeighbors.get(node).clear();                 // Remove "from" links
     
            theNeighbors.remove(node);                      // Remove the node
     
        }
     
     
     
        /**
     
         * Remove the specified link. If link not in graph, nothing happens.
     
         * @param nodeA one end of the link
     
         * @param nodeB the other end of the link
     
         * @throws NullPointerException if either endpoint is not in graph
     
         */
     
        public void remove (N nodeA, N nodeB) throws NullPointerException {
     
            theNeighbors.get(nodeA).remove(nodeB);
     
            theNeighbors.get(nodeB).remove(nodeA);
     
        }
     
     
     
        /**
     
         * Report all the neighbors of node.
     
         * @param node the node
     
         * @return the neighbors of node
     
         * @throws NullPointerException if node does not appear in graph
     
         */
     
        public Set<N> neighbors (N node) throws NullPointerException {
     
            return Collections.unmodifiableSet(theNeighbors.get(node));
     
        }
     
     
     
        /**
     
         * Returns an unmodifiable Set view of the nodes contained in this graph.
     
         * The set is backed by the graph, so changes to the graph are reflected in
     
         * the set.
     
         * @return a Set view of the graph's node set
     
         */
     
        public Set<N> nodeSet () {
     
            return theNodeSet;
     
        }
     
     
     
    }
    voilà arrayset :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    package metier;
     
     
     
    /*
     
     * Copyright (c) 2007 by L. Paul Chew.
     
     *
     
     * Permission is hereby granted, without written agreement and without
     
     * license or royalty fees, to use, copy, modify, and distribute this
     
     * software and its documentation for any purpose, subject to the following
     
     * conditions:
     
     *
     
     * The above copyright notice and this permission notice shall be included
     
     * in all copies or substantial portions of the Software.
     
     *
     
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
     
     * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     
     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     
     * DEALINGS IN THE SOFTWARE.
     
     */
     
     
     
    import java.util.AbstractSet;
     
    import java.util.ArrayList;
     
    import java.util.Collection;
     
    import java.util.Iterator;
     
     
     
    /**
     
     * An ArrayList implementation of Set. An ArraySet is good for small sets; it
     
     * has less overhead than a HashSet or a TreeSet.
     
     *
     
     * @author Paul Chew
     
     *
     
     * Created December 2007.  For use with Voronoi/Delaunay applet.
     
     *
     
     */
     
    public class ArraySet<E> extends AbstractSet<E> {
     
     
     
        private ArrayList<E> items;            // Items of the set
     
     
     
        /**
     
         * Create an empty set (default initial capacity is 3).
     
         */
     
        public ArraySet () {
     
            this(3);
     
        }
     
     
     
        /**
     
         * Create an empty set with the specified initial capacity.
     
         * @param initialCapacity the initial capacity
     
         */
     
        public ArraySet (int initialCapacity) {
     
            items  = new ArrayList<E>(initialCapacity);
     
        }
     
     
     
        /**
     
         * Create a set containing the items of the collection.  Any duplicate
     
         * items are discarded.
     
         * @param collection the source for the items of the small set
     
         */
     
        public ArraySet (Collection<? extends E> collection) {
     
            items = new ArrayList<E>(collection.size());
     
            for (E item: collection)
     
                if (!items.contains(item)) items.add(item);
     
        }
     
     
     
        /**
     
         * Get the item at the specified index.
     
         * @param index where the item is located in the ListSet
     
         * @return the item at the specified index
     
         * @throws IndexOutOfBoundsException if the index is out of bounds
     
         */
     
        public E get (int index) throws IndexOutOfBoundsException {
     
            return items.get(index);
     
        }
     
     
     
        /**
     
         * True iff any member of the collection is also in the ArraySet.
     
         * @param collection the Collection to check
     
         * @return true iff any member of collection appears in this ArraySet
     
         */
     
        public boolean containsAny (Collection<?> collection) {
     
            for (Object item: collection)
     
                if (this.contains(item)) return true;
     
            return false;
     
        }
     
     
     
        @Override
     
        public boolean add(E item) {
     
            if (items.contains(item)) return false;
     
            return items.add(item);
     
        }
     
     
     
        @Override
     
        public Iterator<E> iterator() {
     
            return items.iterator();
     
        }
     
     
     
        @Override
     
        public int size() {
     
            return items.size();
     
        }
     
     
     
    }
    et voilà le message d'erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException
    	at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    	at java.util.AbstractList$Itr.next(Unknown Source)
    	at metier.Principal.update(Principal.java:104)
    	at metier.Principal.insererListe(Principal.java:55)
    	at metier.Principal.<init>(Principal.java:35)
    	at affichage.PanelAffichage.paint(PanelAffichage.java:69)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JLayeredPane.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    	at java.awt.Container.paint(Unknown Source)
    	at java.awt.Window.paint(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
    	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$000(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Bon ça commence à faire beaucoup de boulot de se pencher là-dedans... je vais quand même essayer de circonscrire mon erreur pour que vous ne galériez pas trop à vous y retrouver, à moins que quelque chose ne vous saute aux yeux

    Et pour répondre à la question de jojo, j'ai mis un "Collection<? extends Triangle>" comme retour de ta methode getVoisins() parce que c'est ce que eclipse m'a généré automatiquement comme stub (j'ai fait un appel à getVoisins avant qu'elle n'existe, du coup il m'a proposé de rajouter cette méthode pour corriger l'erreur, je me suis dit qu'il faisait sans doute ça pour une bonne raison mais je suis sans doute à côté de la plaque)

  8. #8
    Membre averti
    Inscrit en
    Juillet 2004
    Messages
    42
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 42
    Par défaut
    bon j'ai fini par m'en sortir, le problème était que j'avais un getter qui me mettait le bazar parce qu'il ne faisait pas que guetter justement, mais qu'il supprimait un élément...

    Merci à tous pour votre aide,

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Iterator et le problème ConcurrentModificationException
    Par mimish dans le forum Général Java
    Réponses: 12
    Dernier message: 11/01/2012, 17h21
  2. Réponses: 10
    Dernier message: 17/06/2009, 17h05
  3. Réponses: 3
    Dernier message: 20/04/2007, 17h03
  4. Problème d'installation oracle 8.1.7 sous NT
    Par Anonymous dans le forum Installation
    Réponses: 7
    Dernier message: 02/08/2002, 14h18
  5. Problème avec la mémoire virtuelle
    Par Anonymous dans le forum CORBA
    Réponses: 13
    Dernier message: 16/04/2002, 16h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo