<commit_before>// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.acceptance;

import com.google.gerrit.reviewdb.client.Change.Id;
import com.google.gerrit.server.index.QueryOptions;
import com.google.gerrit.server.index.Schema;
import com.google.gerrit.server.index.change.ChangeIndex;
import com.google.gerrit.server.query.DataSource;
import com.google.gerrit.server.query.Predicate;
import com.google.gerrit.server.query.QueryParseException;
import com.google.gerrit.server.query.change.ChangeData;
import java.io.IOException;

public class ReadOnlyChangeIndex implements ChangeIndex {
  private final ChangeIndex index;

  public ReadOnlyChangeIndex(ChangeIndex index) {
    this.index = index;
  }

  public ChangeIndex unwrap() {
    return index;
  }

  @Override
  public Schema<ChangeData> getSchema() {
    return index.getSchema();
  }

  @Override
  public void close() {
    index.close();
  }

  @Override
  public void replace(ChangeData obj) throws IOException {
    // do nothing
  }

  @Override
  public void delete(Id key) throws IOException {
    // do nothing
  }

  @Override
  public void deleteAll() throws IOException {
    // do nothing
  }

  @Override
  public DataSource<ChangeData> getSource(Predicate<ChangeData> p, QueryOptions opts)
      throws QueryParseException {
    return index.getSource(p, opts);
  }

  @Override
  public void markReady(boolean ready) throws IOException {
    // do nothing
  }
}
<commit_msg>ReadOnlyChangeIndex: Reduce visibility to package<commit_after>// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.acceptance;

import com.google.gerrit.reviewdb.client.Change.Id;
import com.google.gerrit.server.index.QueryOptions;
import com.google.gerrit.server.index.Schema;
import com.google.gerrit.server.index.change.ChangeIndex;
import com.google.gerrit.server.query.DataSource;
import com.google.gerrit.server.query.Predicate;
import com.google.gerrit.server.query.QueryParseException;
import com.google.gerrit.server.query.change.ChangeData;
import java.io.IOException;

class ReadOnlyChangeIndex implements ChangeIndex {
  private final ChangeIndex index;

  ReadOnlyChangeIndex(ChangeIndex index) {
    this.index = index;
  }

  ChangeIndex unwrap() {
    return index;
  }

  @Override
  public Schema<ChangeData> getSchema() {
    return index.getSchema();
  }

  @Override
  public void close() {
    index.close();
  }

  @Override
  public void replace(ChangeData obj) throws IOException {
    // do nothing
  }

  @Override
  public void delete(Id key) throws IOException {
    // do nothing
  }

  @Override
  public void deleteAll() throws IOException {
    // do nothing
  }

  @Override
  public DataSource<ChangeData> getSource(Predicate<ChangeData> p, QueryOptions opts)
      throws QueryParseException {
    return index.getSource(p, opts);
  }

  @Override
  public void markReady(boolean ready) throws IOException {
    // do nothing
  }
}

{'fraction_non_alphanumeric': 0.09371176902373379, 'fraction_numerical': 0.003914851969659897, 'mean_word_length': 3.7981220657276995, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '835600', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1128, 'n_words': 369}