<commit_before>/*
 * Copyright 2016-2018 Talsma ICT
 *
 * 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 nl.talsmasoftware.umldoclet.issues;

import nl.talsmasoftware.umldoclet.UMLDoclet;
import nl.talsmasoftware.umldoclet.util.Testing;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.util.Comparator;
import java.util.function.Function;
import java.util.spi.ToolProvider;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;

/**
 * @author <NAME>
 */
public class Bug75StackOverflowTest {
    private static final String packageAsPath = Bug75StackOverflowTest.class.getPackageName().replace('.', '/');
    private static final File outputdir = new File("target/test-75");
    private static String classUml, packageUml;

//    public interface Comparable<T> {
//        <U extends Comparable<? super U>> Comparator<T> thenComparing(Function<? super T, ? extends U> keyExtractor);
//    }

    @BeforeClass
    public static void createJavadoc() {
        String classAsPath = packageAsPath + '/' + Bug75StackOverflowTest.class.getSimpleName();
        assertThat("Javadoc result", ToolProvider.findFirst("javadoc").get().run(
                System.out, System.err,
                "-d", outputdir.getPath(),
                "-doclet", UMLDoclet.class.getName(),
                "-umlImageDirectory", "images",
                "src/test/java/" + Bug75StackOverflowTest.class.getName().replace('.', '/') + ".java"
        ) ,is(0));
        classUml = Testing.read(new File(outputdir, classAsPath + ".puml"));
        packageUml = Testing.read(new File(outputdir, packageAsPath + "/package.puml"));
    }

    @Test
    public void testDefaultConstructorShouldBeHidden() {
        assertThat(packageUml, not(containsString("? extends Comparable<? super Comparable<? super Comparable")));
    }

}
<commit_msg>Enable failing test for bug 75 to reproduce StackOverflowError<commit_after>/*
 * Copyright 2016-2018 Talsma ICT
 *
 * 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 nl.talsmasoftware.umldoclet.issues;

import nl.talsmasoftware.umldoclet.UMLDoclet;
import nl.talsmasoftware.umldoclet.util.Testing;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.util.Comparator;
import java.util.function.Function;
import java.util.spi.ToolProvider;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;

/**
 * @author <NAME>
 */
public class Bug75StackOverflowTest {
    private static final String packageAsPath = Bug75StackOverflowTest.class.getPackageName().replace('.', '/');
    private static final File outputdir = new File("target/test-75");
    private static String classUml, packageUml;

    public interface Comparable<T> {
        <U extends Comparable<? super U>> Comparator<T> thenComparing(Function<? super T, ? extends U> keyExtractor);
    }

    @BeforeClass
    public static void createJavadoc() {
        String classAsPath = packageAsPath + '/' + Bug75StackOverflowTest.class.getSimpleName();
        assertThat("Javadoc result", ToolProvider.findFirst("javadoc").get().run(
                System.out, System.err,
                "-d", outputdir.getPath(),
                "-doclet", UMLDoclet.class.getName(),
                "-umlImageDirectory", "images",
                "src/test/java/" + Bug75StackOverflowTest.class.getName().replace('.', '/') + ".java"
        ) ,is(0));
        classUml = Testing.read(new File(outputdir, classAsPath + ".puml"));
        packageUml = Testing.read(new File(outputdir, packageAsPath + "/package.puml"));
    }

    @Test
    public void testDefaultConstructorShouldBeHidden() {
        assertThat(packageUml, not(containsString("? extends Comparable<? super Comparable<? super Comparable")));
    }

}

{'fraction_non_alphanumeric': 0.11328976034858387, 'fraction_numerical': 0.009506833036244802, 'mean_word_length': 3.637281910009183, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, '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': '2895513', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1430, 'n_words': 402}