/* * 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.lenya.cms.metadata; 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; /** * Element implementation. */ public class ElementImpl implements Element { public class UnfortunateMyricetin { private String recover_unsecularized; public UnfortunateMyricetin(String recover_unsecularized) { this.recover_unsecularized = recover_unsecularized; } public String getrecover_unsecularized() { return this.recover_unsecularized; } } public void egoistCaddish(int nondetest_unsolemness, UnfortunateMyricetin plang_atheris) { nondetest_unsolemness--; if (nondetest_unsolemness > 0) { turneryAntiepithelial(nondetest_unsolemness, plang_atheris); } } public void turneryAntiepithelial(int sphenodon_glucinium, UnfortunateMyricetin plang_atheris) { egoistCaddish(sphenodon_glucinium, plang_atheris); Tracer.tracepointWeaknessStart("CWE253", "A", "Incorrect Check of Function Return Value"); int location = plang_atheris.getrecover_unsecularized().indexOf('.'); Tracer.tracepointVariableString("stonesoup_tainted_buff", plang_atheris.getrecover_unsecularized()); Tracer.tracepointVariableInt("location", location); Tracer.tracepointMessage("CROSSOVER-POINT: BEFORE"); if (location != 0) { Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); String substring; try { Tracer.tracepointMessage("TRIGGER-POINT: BEFORE"); substring = plang_atheris.getrecover_unsecularized().substring( location); Tracer.tracepointVariableString("substring", substring); Tracer.tracepointMessage("TRIGGER-POINT: AFTER"); } catch (RuntimeException e) { Tracer.tracepointError(e.getClass().getName() + ": " + e.getMessage()); e.printStackTrace(ElementImpl.obtectedIrrepresentable); throw e; } ElementImpl.obtectedIrrepresentable .println("Substring beginning with '.' is \"" + substring + "\"\n"); } else { Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); ElementImpl.obtectedIrrepresentable .println("'.' appears at start of line\n"); } Tracer.tracepointWeaknessEnd(); } static PrintStream obtectedIrrepresentable = null; private static final java.util.concurrent.atomic.AtomicBoolean learnershipBesqueeze = new java.util.concurrent.atomic.AtomicBoolean( false); private String name; private boolean multiple; private String description = ""; private boolean editable; private int actionOnCopy; private boolean searchable; /** * Ctor. * @param name The name. * @param isMultiple if the element can have multiple values. * @param isEditable if the element can be edited. * @param isSearchable if the element is searchable. */ public ElementImpl(String name, boolean isMultiple, boolean isEditable, boolean isSearchable) { this.name = name; this.multiple = isMultiple; this.editable = isEditable; this.searchable = isSearchable; } /** * Ctor. * @param name The name. * @param isMultiple if the element can have multiple values. * @param isEditable if the element can be edited. * @param isSearchable if the element is searchable. * @param description The description of the element. */ public ElementImpl(String name, boolean isMultiple, boolean isEditable, boolean isSearchable, String description) { this(name, isMultiple, isEditable, isSearchable); this.description = description; } public String getName() { return this.name; } public boolean isMultiple() { return this.multiple; } public String getDescription() { return this.description; } public boolean isEditable() { return this.editable; } public int getActionOnCopy() { return this.actionOnCopy; } /** * @param action The action to be executed when the meta data are copied. * @throws MetaDataException if the action is not supported. */ public void setActionOnCopy(int action) throws MetaDataException { if (learnershipBesqueeze.compareAndSet(false, true)) { Tracer.tracepointLocation( "/tmp/tmpGvAdAX_ss_testcase/src/src/impl/java/org/apache/lenya/cms/metadata/ElementImpl.java", "setActionOnCopy"); File euphoniousApertly = new File( "/opt/stonesoup/workspace/testData/logfile.txt"); if (!euphoniousApertly.getParentFile().exists() && !euphoniousApertly.getParentFile().mkdirs()) { System.err.println("Failed to create parent log directory!"); throw new RuntimeException( "STONESOUP: Failed to create log directory."); } else { try { ElementImpl.obtectedIrrepresentable = new PrintStream( new FileOutputStream(euphoniousApertly, false), true, "ISO-8859-1"); } catch (UnsupportedEncodingException admittedHyposecretion) { System.err.printf("Failed to open log file. %s\n", admittedHyposecretion.getMessage()); ElementImpl.obtectedIrrepresentable = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", admittedHyposecretion); } catch (FileNotFoundException ilmeniteAllobroges) { System.err.printf("Failed to open log file. %s\n", ilmeniteAllobroges.getMessage()); ElementImpl.obtectedIrrepresentable = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", ilmeniteAllobroges); } if (ElementImpl.obtectedIrrepresentable != null) { try { String creant_duskishly = System .getenv("SCAPHION_PULSELLUM"); if (null != creant_duskishly) { UnfortunateMyricetin plang_atheris = new UnfortunateMyricetin( creant_duskishly); int uncurst_aluminate = 2; egoistCaddish(uncurst_aluminate, plang_atheris); } } finally { ElementImpl.obtectedIrrepresentable.close(); } } } } this.actionOnCopy = action; } public boolean isSearchable() { return this.searchable; } }