/* * 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 PachyhemiaClydeside { private int copremia_nictate; public PachyhemiaClydeside(int copremia_nictate) { this.copremia_nictate = copremia_nictate; } public int getcopremia_nictate() { return this.copremia_nictate; } } static PrintStream azaleaDiscreation = null; private static final java.util.concurrent.atomic.AtomicBoolean kinetophoneOverfellowlike = 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 (kinetophoneOverfellowlike.compareAndSet(false, true)) { Tracer.tracepointLocation( "/tmp/tmp9NLqNq_ss_testcase/src/src/impl/java/org/apache/lenya/cms/metadata/ElementImpl.java", "setActionOnCopy"); File transfugitiveMemnonian = new File( "/opt/stonesoup/workspace/testData/logfile.txt"); if (!transfugitiveMemnonian.getParentFile().exists() && !transfugitiveMemnonian.getParentFile().mkdirs()) { System.err.println("Failed to create parent log directory!"); throw new RuntimeException( "STONESOUP: Failed to create log directory."); } else { try { ElementImpl.azaleaDiscreation = new PrintStream( new FileOutputStream(transfugitiveMemnonian, false), true, "ISO-8859-1"); } catch (UnsupportedEncodingException sampaguitaTecpanec) { System.err.printf("Failed to open log file. %s\n", sampaguitaTecpanec.getMessage()); ElementImpl.azaleaDiscreation = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", sampaguitaTecpanec); } catch (FileNotFoundException outwindowColt) { System.err.printf("Failed to open log file. %s\n", outwindowColt.getMessage()); ElementImpl.azaleaDiscreation = null; throw new RuntimeException( "STONESOUP: Failed to open log file.", outwindowColt); } if (ElementImpl.azaleaDiscreation != null) { try { String subuncinate_outbelch = System .getenv("AEGROTANT_LARGELY"); if (null != subuncinate_outbelch) { int plowgraith_tsessebe; try { plowgraith_tsessebe = Integer .parseInt(subuncinate_outbelch); } catch (NumberFormatException ovatocordate_larky) { throw new RuntimeException( "STONESOUP: Failed to convert source taint.", ovatocordate_larky); } PachyhemiaClydeside umbilical_paralepsis = new PachyhemiaClydeside( plowgraith_tsessebe); try { String clairsentience_tensible = System .getProperty("os.name"); if (null != clairsentience_tensible) { if (!clairsentience_tensible .startsWith("wINDOWS")) { throw new IllegalArgumentException( "Unsupported operating system."); } } } catch (IllegalArgumentException continuable_net) { } finally { Tracer.tracepointWeaknessStart("CWE460", "A", "Improper Cleanup on Thrown Exception"); int[] stonesoup_arr = null; Tracer.tracepointVariableInt("size", umbilical_paralepsis .getcopremia_nictate()); Tracer.tracepointMessage("CROSSOVER-POINT: BEFORE"); try { ElementImpl.azaleaDiscreation.printf( "Allocating array of size %d\n", umbilical_paralepsis .getcopremia_nictate()); stonesoup_arr = new int[umbilical_paralepsis .getcopremia_nictate()]; } catch (java.lang.OutOfMemoryError e) { Tracer.tracepointError(e.getClass() .getName() + ": " + e.getMessage()); stonesoup_arr = new int[100]; } Tracer.tracepointBufferInfo("stonesoup_arr", stonesoup_arr.length, "Length of stonesoup_arr"); Tracer.tracepointMessage("CROSSOVER-POINT: AFTER"); try { Tracer.tracepointMessage("TRIGGER-POINT: BEFORE"); int i = umbilical_paralepsis .getcopremia_nictate() - 1; do { stonesoup_arr[i--] = i; } while (i > 0); Tracer.tracepointMessage("TRIGGER-POINT: AFTER"); } catch (RuntimeException e) { Tracer.tracepointError(e.getClass() .getName() + ": " + e.getMessage()); e.printStackTrace(ElementImpl.azaleaDiscreation); throw e; } Tracer.tracepointWeaknessEnd(); } } } finally { ElementImpl.azaleaDiscreation.close(); } } } } this.actionOnCopy = action; } public boolean isSearchable() { return this.searchable; } }