Israel considers legality of barrier