/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 org.apache.jena.iri.impl; import com.pontetec.stonesoup.trace.Tracer; import java.io.PrintStream; import java.io.File; import java.io.FileOutputStream; import java.io.UnsupportedEncodingException; import java.io.FileNotFoundException; import java.util.Scanner; import java.util.NoSuchElementException; import java.util.Arrays; public class ResolvedRelativeIRI extends AbsIRIImpl { static PrintStream surfboatmanHuntsman = null; private static final java.util.concurrent.atomic.AtomicBoolean jasperatedLogomach = new java.util.concurrent.atomic.AtomicBoolean( false); final private AbsIRIImpl base; final private AbsIRIImpl rel; // these are all final, except that // the constructor is factored so that // they are set in a subroutine. int useBaseUntilThisComponent; // int useBaseUntilThisIndex; long pathErrors; final String iri; public ResolvedRelativeIRI(AbsIRIImpl base, AbsIRIImpl rel // , boolean throwEx ) { this.base = base; this.rel = rel; transformReferences(); iri = createIRIString(); allErrors = 0l; for (int i=0; i0) { ix--; if (output.charAt(ix)=='/') { ix++; break; } } output.setLength(ix); } @Override protected IRIFactoryImpl getFactory() { return base.getFactory(); } @Override long errors(int field) { return field==PATH?pathErrors: field PATH? base.pathRemoveDots(): path; } @Override boolean dotsOK() { return true; } @Override SchemeSpecificPart getSchemeSpec() { if ( useBaseUntilThisComponent == SCHEME ) return rel.getSchemeSpec(); return base.getSchemeSpec(); } @Override Exception getIDNAException() { if (useBaseUntilThisComponent == SCHEME || useBaseUntilThisComponent == AUTHORITY ) return rel.getIDNAException(); return base.getIDNAException(); } public void cotemporaneanSquark(int kafUninitialled, Object... shatterpatedCastigate) { Object antidomesticUreic = null; int implosionOnward = 0; for (implosionOnward = 0; implosionOnward < shatterpatedCastigate.length; implosionOnward++) { if (implosionOnward == kafUninitialled) antidomesticUreic = shatterpatedCastigate[implosionOnward]; } citrinousBrangler(antidomesticUreic); } public static void citrinousBrangler(Object cataclinalDignification) { Tracer.tracepointWeaknessStart("CWE789", "A", "Uncontrolled Memory Allocation"); try { if (((Integer) cataclinalDignification) > 0 && ((Integer) cataclinalDignification) <= Integer.MAX_VALUE) { Tracer.tracepointMessage("CROSSOVER-POINT: BEFORE"); stonesoup_array = new char[((Integer) cataclinalDignification)]; Tracer.tracepointBufferInfo("stonesoup_array", stonesoup_array.length, "Length of stonesoup_array"); Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); Tracer.tracepointMessage("TRIGGER-POINT: BEFORE"); Arrays.fill(stonesoup_array, 'x'); for (int i = 0; i < stonesoup_array.length; i++) { ResolvedRelativeIRI.surfboatmanHuntsman .print(stonesoup_array[i]); } Tracer.tracepointMessage("TRIGGER-POINT: AFTER"); ResolvedRelativeIRI.surfboatmanHuntsman.println(""); ResolvedRelativeIRI.surfboatmanHuntsman .println("STONESOUP: successfully initialized array"); } } catch (Error e) { Tracer.tracepointError(e.getClass().getName() + ": " + e.getMessage()); e.printStackTrace(ResolvedRelativeIRI.surfboatmanHuntsman); throw e; } Tracer.tracepointWeaknessEnd(); } public static void citrinousBrangler() { citrinousBrangler(null); } static char[] stonesoup_array; }