IT IS JUST as well that Virginia Circuit Judge James B. Wilkinson changed his mind about putting reporter David Chandler in jail. Mr. Chandler, of the Norfolk Ledger-Star, seemed to be as firm in his refusal to give a grand jury the names of those who told him about alleged corruption in the state government as Judge Wilkinson was in his position that Mr. Chandler would talk or else. The case had all the earmarks -- and all the unpleasantness -- of a classic confrontation over a journalist's right to conceal confidential sources, until something persuaded the judge to revoke his contempt order.

We are not privy to what that something was. But it had seemed to us that the grand jury and the prosecutor were a little too eager to have Mr. Chandler do their work for them. He says he gave the grand jury all the information it wanted except for the names of his sources. With that information, especially since it appears to have included a list of leads, an alert investigating body should have little difficulty finding the evidence it needs.

Whether that evidence comes directly, and quickly, from Mr. Chandler's sources or from somewhere else, perhaps a little more slowly, is irrelevant to the function the grand jury is performing. But it is not irrelevant to the function Mr. Chandler has performed. His news stories were the result of whistle-blowing by government officials. Some officials, and at least one businessman, are said to have told him that certain state purchasing agents received expensive presents from some businessmen in exchange for favorable consideration of their bids for contracts. The danger of a judge's compelling a reporter to yield the names of sources in that kind of situation lies in the inhibiting effect such an order would have on future whistle-blowers.

That was one of the factors that led the Supreme Court to rule several years ago that grand juries and prosecutors must always look for information elsewhere before trying to force journalists to reveal confidential sources. It is not a consideration to be brushed aside lightly, even though it may force investigative bodies to track over the same ground that a reporter has previously investigated. It is not the function of the press to bundle up evidence of wrongdoing and present it to a grand jury. Journalists are in the business only of telling the public where wrongdoing may exist and, in the process, pointing grand juries in the right direction. That, it seems to us, is exactly what Mr. Chandler did.