hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
3aecc95f2df92e7918c190e4cc3ce1dcd98c60aa
2,047
package com.reactnativechat; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; public class GoogleAnalyticsBridge extends ReactContextBaseJavaModule { private Tracker mTracker; public GoogleAnalyticsBridge(ReactApplicationContext reactContext) { super(reactContext); } synchronized public Tracker getDefaultTracker() { if (mTracker == null) { GoogleAnalytics analytics = GoogleAnalytics.getInstance(getReactApplicationContext()); // To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG mTracker = analytics.newTracker(R.xml.global_tracker); } return mTracker; } @Override public String getName() { return "GoogleAnalyticsBridge"; } synchronized GoogleAnalytics getAnalyticsInstance() { return GoogleAnalytics.getInstance(getReactApplicationContext()); } @ReactMethod public void screenView(String screenName) { Tracker tracker = getDefaultTracker(); tracker.setScreenName(screenName); tracker.send(new HitBuilders.ScreenViewBuilder().build()); } @ReactMethod public void trackEvent(String category, String action, ReadableMap optionalValues) { Tracker tracker = getDefaultTracker(); HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder(); builder.setCategory(category); builder.setAction(action); if (optionalValues.hasKey("label")) { builder.setLabel(optionalValues.getString("label")); } if (optionalValues.hasKey("value")) { builder.setValue(optionalValues.getInt("value")); } tracker.send(builder.build()); } @ReactMethod public void setUser(String userId) { Tracker tracker = getDefaultTracker(); tracker.set("&uid", userId); } }
29.666667
92
0.749389
0c41737bc23cd81f0332690ef61a09187e1c6c9f
1,106
package charbosses.relics; import charbosses.bosses.AbstractCharBoss; import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.powers.StrengthPower; import com.megacrit.cardcrawl.relics.AbstractRelic; import com.megacrit.cardcrawl.relics.Vajra; public class CBR_Vajra extends AbstractCharbossRelic { public static final String ID = "Vajra"; private static final int STR = 1; public CBR_Vajra() { super(new Vajra()); } @Override public String getUpdatedDescription() { return this.DESCRIPTIONS[0] + 1 + this.DESCRIPTIONS[1]; } @Override public void atBattleStart() { this.flash(); this.addToTop(new ApplyPowerAction(AbstractCharBoss.boss, AbstractCharBoss.boss, new StrengthPower(AbstractCharBoss.boss, 1), 1)); this.addToTop(new RelicAboveCreatureAction(AbstractCharBoss.boss, this)); } @Override public AbstractRelic makeCopy() { return new CBR_Vajra(); } }
31.6
139
0.708861
61ed0b279b0d9f9245f8621005574467746e9166
2,252
package put.ci.cevo.experiments.reports; import static java.lang.Integer.parseInt; import static java.util.Collections.singletonList; import static org.apache.commons.lang.StringUtils.isEmpty; import static org.apache.commons.lang.StringUtils.split; import static put.ci.cevo.experiments.ConfiguredExperiment.Config.RETROSPECTION_TASKS; import static put.ci.cevo.util.filter.Filters.notNull; import static put.ci.cevo.util.sequence.Sequences.flatten; import static put.ci.cevo.util.sequence.Sequences.range; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; import put.ci.cevo.util.configuration.Configuration; import put.ci.cevo.util.sequence.AsyncTransformSequence; import put.ci.cevo.util.sequence.transforms.Transform; public class TasksConverter { private static final Configuration configuration = Configuration.getConfiguration(); private static final String SEPARATOR_PATTERN = "\\.\\.|(?: |^)-(?: |$)|,"; private static final Pattern RANGE_PATTERN = Pattern.compile("^(.*?)\\s*(?:" + SEPARATOR_PATTERN + ")\\s*(.*?)$"); public static List<Integer> convert(String tasks) { if (isEmpty(tasks)) { return Collections.emptyList(); } tasks = tasks.trim(); if (StringUtils.isNumeric(tasks)) { return singletonList(parseInt(tasks)); } if (tasks.equals("*")) { return configuration.getImmediateSubKeys(RETROSPECTION_TASKS).transform(new Transform<String, Integer>() { @Override public Integer transform(String value) { return parseInt(value); } }).toList(); } if (tasks.contains(";")) { return flatten(new AsyncTransformSequence<String, List<Integer>>(Arrays.asList(split(tasks, ";"))) { @Override protected void getNext(String subtask) { next(convert(subtask)); } }.filter(notNull())).toImmutableList(); } Matcher matcher = RANGE_PATTERN.matcher(tasks); if (!matcher.find()) { throw new RuntimeException("Unable to parse range: " + tasks); } return range(parseInt(matcher.group(1)), parseInt(matcher.group(2)) + 1).toList(); } public static void main(String[] args) { System.out.println(convert("1..5;7")); } }
31.71831
115
0.732238
559524237a51cd723a039a30c46b5c8381e5acb6
126
@Value.Style(depluralize = true) package org.cloudfoundry.multiapps.controller.core.model; import org.immutables.value.Value;
31.5
57
0.825397
f9a1a8076455c36765cbb75797bd86ad33abe680
747
package test; import de.spraener.nxtgen.Cartridge; import de.spraener.nxtgen.CodeGeneratorMapping; import de.spraener.nxtgen.Transformation; import de.spraener.nxtgen.model.Model; import de.spraener.nxtgen.model.ModelElement; import java.util.ArrayList; import java.util.List; public class GroovyCartridge implements Cartridge { @Override public String getName() { return "GroovyCartridge"; } @Override public List<Transformation> getTransformations() { List<Transformation> result = new ArrayList<>(); return result; } @Override public List<CodeGeneratorMapping> mapGenerators(Model m) { for(ModelElement me : m.getModelElements() ) { } return null; } }
21.970588
62
0.701473
9e223cef2a18b1c9e144c97b13b2752db9305268
2,211
package highwin.zgs.contactindex.utils; import android.content.Context; import android.support.annotation.IntDef; import android.view.Gravity; import android.view.View; import android.widget.TextView; import android.widget.Toast; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import highwin.zgs.contactindex.R; /** * User: zgsHighwin * Email: 799174081@qq.com Or 799174081@gmail.com * Description: * Create-Time: 2016/8/24 9:51 */ public class ToastUtils { public static Toast mToast; public static final int LENGTH_SHORT = 0; public static final int LENGTH_LONG = 1; @IntDef({LENGTH_SHORT, LENGTH_LONG}) @Retention(RetentionPolicy.SOURCE) public @interface Duration { } public static void showToast(Context mContext, String msg) { if (mToast == null) { mToast = Toast.makeText(mContext, "", Toast.LENGTH_SHORT); } mToast.setText(msg); mToast.show(); } /** * 自定义的土司 * * @param text 显示的内容 */ public static void showCustomToast(Context context, String text) { showCustomToast(context, text, Gravity.CENTER); } public static void showCustomToast(Context context, String text, int gravity) { showCustomToast(context, text, gravity, 0, 0); } public static void showCustomToast(Context context, String text, int gravity, int xOffset, int yOffset) { showCustomToast(context, text, gravity, xOffset, yOffset, ToastUtils.LENGTH_SHORT); } /** * show customToast */ public static void showCustomToast(Context context, String text, int gravity, int xOffset, int yOffset, @Duration int duration) { if (mToast == null) { mToast = new Toast(context); } View view = View.inflate(context, R.layout.mytoast, null); TextView tv = (TextView) view.findViewById(R.id.tv); //设置显示内容 tv.setText(text); mToast.setView(view); //设置Toast显示的时长。0表示短,1表示常 mToast.setDuration(duration); //设置Toast显示在窗体中的位置(这里是显示在窗体顶部的中央) mToast.setGravity(gravity, xOffset, yOffset); //将Toast显示出来 mToast.show(); } }
28.346154
133
0.664405
febeda2bf69d08dc7579018161a72190f62b6091
1,311
/* GENERATED SOURCE. DO NOT MODIFY. */ /* * Copyright 2017 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.android.org.conscrypt; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotates a program element (class, method, package etc) which is internal to Conscrypt, not part * of * the public API, and should not be used by users of Conscrypt. */ @Internal @Retention(RetentionPolicy.SOURCE) @Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.PACKAGE, ElementType.TYPE}) @Documented public @interface Internal {}
35.432432
100
0.763539
6e2de8fdceca38dfc7d5dec5e879c47cc8f75160
5,597
// Automatically generated; do not edit package com.mylife.test; import org.json.*; /** * Construct objects of type sample_sum. */ public class SampleSum { Tag t = null; public SampleSum() { } public Tag tag() { return t; } /** * Define tags for sum type sample_sum. */ public enum Tag { SIMPLE_TAG, BOOL, INT_, FLOAT_, S, SIMPLE_RECORD, COMPLEX_RECORD, RECORD_WITH_DEFAULTS } public SampleSum(Object o) throws JSONException { String tag = Util.extractTag(o); if (tag.equals("Simple_tag")) t = Tag.SIMPLE_TAG; else if (tag.equals("Bool")) { field_bool = ((JSONArray)o).getBoolean(1); t = Tag.BOOL; } else if (tag.equals("Int")) { field_int_ = ((JSONArray)o).getInt(1); t = Tag.INT_; } else if (tag.equals("Float")) { field_float_ = ((JSONArray)o).getDouble(1); t = Tag.FLOAT_; } else if (tag.equals("String")) { field_s = ((JSONArray)o).getString(1); t = Tag.S; } else if (tag.equals("Simple_record")) { field_simple_record = new SimpleRecord(((JSONArray)o).getJSONObject(1)); t = Tag.SIMPLE_RECORD; } else if (tag.equals("Complex_record")) { field_complex_record = new ComplexRecord(((JSONArray)o).getJSONObject(1)); t = Tag.COMPLEX_RECORD; } else if (tag.equals("Record_with_defaults")) { field_record_with_defaults = new RecordWithDefaults(((JSONArray)o).getJSONObject(1)); t = Tag.RECORD_WITH_DEFAULTS; } else throw new JSONException("Invalid tag: " + tag); } public void setSimpleTag() { /* TODO: clear previously-set field and avoid memory leak */ t = Tag.SIMPLE_TAG; } Boolean field_bool = null; public void setBool(Boolean x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.BOOL; field_bool = x; } public Boolean getBool() { if (t == Tag.BOOL) return field_bool; else return null; } Integer field_int_ = null; public void setInt(Integer x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.INT_; field_int_ = x; } public Integer getInt() { if (t == Tag.INT_) return field_int_; else return null; } Double field_float_ = null; public void setFloat(Double x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.FLOAT_; field_float_ = x; } public Double getFloat() { if (t == Tag.FLOAT_) return field_float_; else return null; } String field_s = null; public void setS(String x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.S; field_s = x; } public String getS() { if (t == Tag.S) return field_s; else return null; } SimpleRecord field_simple_record = null; public void setSimpleRecord(SimpleRecord x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.SIMPLE_RECORD; field_simple_record = x; } public SimpleRecord getSimpleRecord() { if (t == Tag.SIMPLE_RECORD) return field_simple_record; else return null; } ComplexRecord field_complex_record = null; public void setComplexRecord(ComplexRecord x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.COMPLEX_RECORD; field_complex_record = x; } public ComplexRecord getComplexRecord() { if (t == Tag.COMPLEX_RECORD) return field_complex_record; else return null; } RecordWithDefaults field_record_with_defaults = null; public void setRecordWithDefaults(RecordWithDefaults x) { /* TODO: clear previously-set field in order to avoid memory leak */ t = Tag.RECORD_WITH_DEFAULTS; field_record_with_defaults = x; } public RecordWithDefaults getRecordWithDefaults() { if (t == Tag.RECORD_WITH_DEFAULTS) return field_record_with_defaults; else return null; } public void toJsonBuffer(StringBuilder _out) throws JSONException { if (t == null) throw new JSONException("Uninitialized SampleSum"); else { switch(t) { case SIMPLE_TAG: _out.append("\"Simple_tag\""); break; case BOOL: _out.append("[\"Bool\","); _out.append(String.valueOf(field_bool)); _out.append("]"); break; case INT_: _out.append("[\"Int\","); _out.append(String.valueOf(field_int_)); _out.append("]"); break; case FLOAT_: _out.append("[\"Float\","); _out.append(String.valueOf(field_float_)); _out.append("]"); break; case S: _out.append("[\"String\","); Util.writeJsonString(_out, field_s); _out.append("]"); break; case SIMPLE_RECORD: _out.append("[\"Simple_record\","); field_simple_record.toJsonBuffer(_out); _out.append("]"); break; case COMPLEX_RECORD: _out.append("[\"Complex_record\","); field_complex_record.toJsonBuffer(_out); _out.append("]"); break; case RECORD_WITH_DEFAULTS: _out.append("[\"Record_with_defaults\","); field_record_with_defaults.toJsonBuffer(_out); _out.append("]"); break; default: break; /* unused; keeps compiler happy */ } } } public String toJson() throws JSONException { StringBuilder out = new StringBuilder(128); toJsonBuffer(out); return out.toString(); } }
25.440909
91
0.616044
8bb381100620162e2c2a19b4731e22726da8823a
5,541
/* * Copyright (c) 2016, SICS, Swedish ICT AB. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /** * \file * A Java IPv4 transport for CoAP + LWM2M * Converts hex input to DTLS/UDP packets and incoming packets to * hex out. * * Note: This needs the eclipse scandium DTLS implementation to work. * The example use PSK and the keys according to the code. This needs * to be configured in Leshan for it to accept the device. * \author * Joakim Eriksson <joakime@sics.se> * Niclas Finne <nfi@sics.se> */ import javax.xml.bind.DatatypeConverter; import java.net.DatagramSocket; import java.net.DatagramPacket; import java.net.InetAddress; import java.net.InetSocketAddress; import java.io.IOException; import java.util.Arrays; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; import java.io.PrintStream; import org.eclipse.californium.scandium.dtls.pskstore.StaticPskStore; import org.eclipse.californium.scandium.config.DtlsConnectorConfig; import org.eclipse.californium.scandium.DTLSConnector; import org.eclipse.californium.elements.RawData; import org.eclipse.californium.elements.RawDataChannel; public class Hex2DTLS { DTLSConnector dtlsConnector; InetAddress address; int port; Hex2DTLS(String host, int port) { try { DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); builder.setPskStore(new StaticPskStore("Client_Identity", "secretPSK".getBytes())); builder.setClientOnly(); dtlsConnector = new DTLSConnector(builder.build(), null); dtlsConnector.setRawDataReceiver(new RawDataChannel() { public void receiveData(final RawData raw) { receive(raw.getBytes()); } }); dtlsConnector.start(); this.address = InetAddress.getByName(host); this.port = port; } catch(Exception e) { e.printStackTrace(); } } public void send(byte[] data) throws IOException { RawData rawData = new RawData(data, address, port); dtlsConnector.send(rawData); } /* Override this to make something more sensible with the data */ public void receive(byte[] data) { String s = DatatypeConverter.printHexBinary(data); System.out.println("COAPHEX:" + s); } /* Loop on std in to get lines of hex to send */ public static void main(String[] args) throws IOException { InputStream in = System.in; final PrintStream out; System.err.println("Connecting to " + args[0]); if(args.length > 1) { Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(args[1]); System.err.println("Started " + args[1]); in = pr.getInputStream(); out = new PrintStream(pr.getOutputStream()); } else { out = System.out; } /* Create a Hex2DTLS that print on this out stream . CoAPs Port*/ Hex2DTLS udpc = new Hex2DTLS(args[0], 5684) { public void receive(byte[] data) { String s = DatatypeConverter.printHexBinary(data); out.println("COAPHEX:" + s); out.flush(); System.err.println("IN: " + s); } }; BufferedReader buffer = new BufferedReader(new InputStreamReader(in)); /* The read loop */ while(true) { String line = buffer.readLine(); if(line == null) { /* Connection closed */ System.err.println("*** stdin closed"); System.exit(0); } else if (line.startsWith("COAPHEX:")) { byte[] data = DatatypeConverter.parseHexBinary(line.substring(8)); udpc.send(data); } System.err.println("OUT:" + line); } } }
39.021127
108
0.645551
00385187702b8a3ae3d9f639e0e8c8c7ddbf5bd6
1,092
package be.artisjaap.polyglot.core.action.translationloader; import be.artisjaap.polyglot.core.model.verbs.TimeOfVerb; import lombok.Builder; import lombok.Getter; import org.springframework.stereotype.Component; import java.util.regex.Matcher; import java.util.regex.Pattern; public class TagTense implements TranslationTag<ParsedTense> { private Pattern pattern = Pattern.compile("@Tense=(.*)"); private String rawData; private TagTense(String rawString){ this.rawData = rawString; } public static TagTense of(String rawData){ return new TagTense(rawData); } @Override public TagName tagName() { return TagName.TENSE; } @Override public ParsedTense parsedTag() { Matcher matcher = pattern.matcher(rawData); if(matcher.find()){ return ParsedTense.builder() .timeOfVerb(TimeOfVerb.valueOf(matcher.group(1).toUpperCase())) .build(); } return null; } } @Builder @Getter class ParsedTense { private TimeOfVerb timeOfVerb; }
22.75
83
0.669414
9d3d04c22881f1f630a2c79e03d60f680fccaf25
378
package com.google.android.gms.common.util; import java.util.regex.Pattern; /* renamed from: com.google.android.gms.common.util.o */ public class C1389o { private static final Pattern f3234a; static { f3234a = Pattern.compile("\\$\\{(.*?)\\}"); } public static boolean m4973a(String str) { return str == null || str.trim().isEmpty(); } }
22.235294
56
0.62963
9d81debb1ed427166f43e68a97daf05602143d72
2,272
package org.nuclearfog.twidda.adapter.holder; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import org.nuclearfog.twidda.R; import org.nuclearfog.twidda.database.GlobalSettings; import static android.graphics.PorterDuff.Mode.SRC_IN; /** * Holder class for the tweet view * * @author nuclearfog * @see org.nuclearfog.twidda.adapter.TweetAdapter */ public class TweetHolder extends RecyclerView.ViewHolder { public final TextView[] textViews = new TextView[7]; public final ImageView profile, rtUser, verifiedIcon, lockedIcon, rtIcon, favIcon; public TweetHolder(@NonNull View v, GlobalSettings settings) { super(v); CardView background = (CardView) v; profile = v.findViewById(R.id.tweetPb); verifiedIcon = v.findViewById(R.id.verified_icon); lockedIcon = v.findViewById(R.id.locked_icon); rtUser = v.findViewById(R.id.rt_user_icon); rtIcon = v.findViewById(R.id.rt_icon); favIcon = v.findViewById(R.id.fav_icon); textViews[0] = v.findViewById(R.id.username); textViews[1] = v.findViewById(R.id.screenname); textViews[2] = v.findViewById(R.id.tweettext); textViews[3] = v.findViewById(R.id.retweet_number); textViews[4] = v.findViewById(R.id.favorite_number); textViews[5] = v.findViewById(R.id.retweeter); textViews[6] = v.findViewById(R.id.time); verifiedIcon.setImageResource(R.drawable.verify); lockedIcon.setImageResource(R.drawable.lock); rtUser.setImageResource(R.drawable.retweet); rtIcon.setImageResource(R.drawable.retweet); favIcon.setImageResource(R.drawable.favorite); verifiedIcon.setColorFilter(settings.getIconColor(), SRC_IN); lockedIcon.setColorFilter(settings.getIconColor(), SRC_IN); rtUser.setColorFilter(settings.getIconColor(), SRC_IN); background.setCardBackgroundColor(settings.getCardColor()); for (TextView tv : textViews) { tv.setTextColor(settings.getFontColor()); tv.setTypeface(settings.getTypeFace()); } } }
39.172414
86
0.709067
811f4c84193264c381069e1826a5038ff267c8f9
2,003
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jitsi.impl.neomedia.codec.audio.silk; /** * R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP * Parameters Using Structured Vector Quantization", Proc. IEEE Int. Conf. Acoust., Speech, * Signal Processing, pp. 641-644, 1991. * * @author Dingxin Xu */ public class NLSFVQWeightsLaroiaFLP { static float MIN_NDELTA = ( 1e-6f / SigProcFLP.PI ); /** * Laroia low complexity NLSF weights. * @param pXW Pointer to input vector weights [D x 1] * @param pX Pointer to input vector [D x 1] * @param D Input vector dimension */ static void SKP_Silk_NLSF_VQ_weights_laroia_FLP( float []pXW, /* 0: Pointer to input vector weights [D x 1] */ final float []pX, /* I: Pointer to input vector [D x 1] */ final int D /* I: Input vector dimension */ ) { int k; float tmp1, tmp2; /* Safety checks */ assert( D > 0 ); assert( ( D & 1 ) == 0 ); /* First value */ tmp1 = 1.0f / ( pX[ 0 ] > MIN_NDELTA ? pX[0]:MIN_NDELTA); tmp2 = 1.0f / ((pX[ 1 ] - pX[ 0 ])>MIN_NDELTA ?(pX[ 1 ] - pX[ 0 ]):MIN_NDELTA); pXW[ 0 ] = tmp1 + tmp2; /* Main loop */ for( k = 1; k < D - 1; k += 2 ) { tmp1 = 1.0f / ((pX[ k + 1 ] - pX[ k ])>MIN_NDELTA ? (pX[ k + 1 ] - pX[ k ]):MIN_NDELTA); pXW[ k ] = tmp1 + tmp2; tmp2 = 1.0f / ((pX[ k + 2 ] - pX[ k + 1 ]) >MIN_NDELTA ?(pX[ k + 2 ] - pX[ k + 1 ]):MIN_NDELTA); pXW[ k + 1 ] = tmp1 + tmp2; } /* Last value */ tmp1 = 1.0f / ( (1.0f - pX[ D - 1 ])> MIN_NDELTA ?(1.0f - pX[ D - 1 ]):MIN_NDELTA); pXW[ D - 1 ] = tmp1 + tmp2; } }
34.534483
108
0.49975
15d5d0a02af1d7c9e959f29755cdf004a7947f7b
2,827
package org.linuxlsx.algo.leetcode; import java.util.HashMap; import java.util.Map; /** * Solution of <a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/">Longest Substring Without Repeating Characters</a> * * Created by linuxlsx on 16/9/9. */ public class LengthOfLongestSubstring { /** * 思路: 通过两个循环遍历字符串,循环过程中记录最大的子串的长度。 * * <ul> * <li>算法复杂度 O(n^2) 当字符串没有重复字符时 最好: O(n) 当字符串全为相同字符时</li> * <li>控件复杂度 O(n) n 为字符串中不重复的字符数量</li> * </ul> * @param s * @return */ public int lengthOfLongestSubstring(String s) { int maxLength = 0; Map<Character, String> map = new HashMap<Character, String>(); int length = s.length(); for (int i = 0; i < length; i++) { int len = 0; int tmp = i; for (int j = i; j < length; j++) { Character key = new Character(s.charAt(j)); if(map.containsKey(key)){ break; }else { map.put(key, "1"); } } len = map.size(); if(len > maxLength){ maxLength = len; } //当最大长度已经大于剩余的子串长度时,可认为已经找到最大值,这样可以将最坏情况下的O(n^2) 提升为 O(n) //实际判定中 比不加该判断减少了 20% 左右的时间 //加之前 106ms , 加之后 85 if(maxLength >= (length - tmp)){ break; } map.clear(); } return maxLength; } /** * 思路来源: 左耳朵耗子 <a href="https://github.com/haoel/leetcode/blob/master/algorithms/cpp/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp">longestSubstringWithoutRepeatingCharacters</a> * <br /> * 思路: 决定子串长度的主要因素是重复字符出现的位置. 最近一次出现重复字符的位置与当前位置的差就是子串的长度 * * <ul> * <li>算法复杂度 O(n) 一次遍历即可 实测 20ms 以内</li> * <li>空间复杂度 O(n) n 为字符串中不重复的字符数量</li> * </ul> * @param s * @return */ public int lengthOfLongestSubstringV2(String s){ int maxLength = 0; Map<Character, Integer> map = new HashMap<Character, Integer>(); int length = s.length(); int lastRepeatIndex = -1; for (int i = 0; i < length; i++) { Character ch = new Character(s.charAt(i)); if(map.get(ch) != null && lastRepeatIndex < map.get(ch)){ lastRepeatIndex = map.get(ch); } if(i - lastRepeatIndex > maxLength){ maxLength = i - lastRepeatIndex; } map.put(ch, i); } return maxLength; } public static void main(String[] args) { LengthOfLongestSubstring s = new LengthOfLongestSubstring(); System.out.println(s.lengthOfLongestSubstringV2("c")); } }
25.93578
226
0.534489
d0bb7d674159cf678c9e74a14b03224c65f5e49c
4,145
package com.testsigma.service; import com.testsigma.config.AdditionalPropertiesConfig; import com.testsigma.model.AuthUser; import com.testsigma.model.AuthenticationType; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.InternalAuthenticationServiceException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService; import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.core.OAuth2AuthenticationException; import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.stereotype.Service; import java.util.UUID; @Service @Log4j2 @RequiredArgsConstructor(onConstructor = @__(@Autowired)) public class AuthUserService implements UserDetailsService, OAuth2UserService<OidcUserRequest, OidcUser> { private final AdditionalPropertiesConfig authenticationConfig; @Setter private BCryptPasswordEncoder bCryptPasswordEncoder; private final ServerService serverService; @Override public UserDetails loadUserByUsername(String name) throws UsernameNotFoundException { AuthUser authUser = new AuthUser(); authUser.setUuid(UUID.randomUUID().toString()); setServerUuid(authUser); switch (authenticationConfig.getAuthenticationType()) { case FORM: authUser.setEmail(authenticationConfig.getUserName()); authUser.setUserName(authenticationConfig.getUserName()); authUser.setPassword(bCryptPasswordEncoder.encode(authenticationConfig.getPassword())); authUser.setAuthenticationType(AuthenticationType.FORM); if (!authUser.getUsername().equals(name)) { throw new UsernameNotFoundException("Unable to find user with name - " + name); } break; case API: authUser.setAuthenticationType(AuthenticationType.API); break; case NO_AUTH: authUser.setAuthenticationType(AuthenticationType.NO_AUTH); break; case JWT: authUser.setAuthenticationType(AuthenticationType.JWT); break; case OIDC: authUser.setAuthenticationType(AuthenticationType.OIDC); break; default: throw new UsernameNotFoundException("Unable to find user with name - " + name); } return authUser; } @Override public OidcUser loadUser(OidcUserRequest oidcUserRequest) throws OAuth2AuthenticationException { OidcUser oidcUser = new OidcUserService().loadUser(oidcUserRequest); try { AuthUser authUser = new AuthUser(); setServerUuid(authUser); String email = oidcUser.getAttributes().get("email").toString(); if (StringUtils.isEmpty(email)) throw new UsernameNotFoundException("Unable to find user - " + email); authUser.setEmail(oidcUser.getEmail()); authUser.setUserName(oidcUser.getFullName()); authUser.setClaims(oidcUser.getClaims()); authUser.setUserInfo(oidcUser.getUserInfo()); authUser.setIdToken(oidcUser.getIdToken()); authUser.setAuthenticationType(AuthenticationType.OIDC); authUser.setUuid(UUID.randomUUID().toString()); return authUser; } catch (Exception ex) { log.error(ex.getMessage(), ex); throw new InternalAuthenticationServiceException(ex.getMessage(), ex.getCause()); } } private void setServerUuid(AuthUser authUser) { try { if (StringUtils.isEmpty(authUser.getServerUuid())) { authUser.setServerUuid(serverService.findOne().getServerUuid()); } } catch (Exception ex) { log.error(ex.getMessage(), ex); } } }
41.039604
106
0.75971
af5c41f033d37235da39718716fec4cb139964c4
4,112
/** * Copyright (C) 2016 LibRec * * This file is part of LibRec. * LibRec is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * LibRec is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LibRec. If not, see <http://www.gnu.org/licenses/>. */ package net.librec.data.splitter; import net.librec.BaseTestCase; import net.librec.conf.Configured; import net.librec.data.convertor.TextDataConvertor; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import static org.junit.Assert.assertEquals; /** * LOOCVDataSplitter TestCase * {@link net.librec.data.splitter.LOOCVDataSplitter} * * @author Liuxz and Sunyt */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class LOOCVDataSplitterTestCase extends BaseTestCase { private TextDataConvertor convertor; private TextDataConvertor convertorWithDate; @Before public void setUp() throws Exception { super.setUp(); conf.set("inputDataPath", conf.get("dfs.data.dir") + "/test/datamodeltest/matrix4by4.txt"); conf.set(Configured.CONF_DATA_COLUMN_FORMAT, "UIR"); convertor = new TextDataConvertor(conf.get(Configured.CONF_DATA_COLUMN_FORMAT), conf.get("inputDataPath")); conf.set(Configured.CONF_DATA_COLUMN_FORMAT, "UIRT"); conf.set("inputDataPath", conf.get("dfs.data.dir") + "/test/datamodeltest/matrix4by4-date.txt"); convertorWithDate = new TextDataConvertor(conf.get(Configured.CONF_DATA_COLUMN_FORMAT), conf.get("inputDataPath")); } /** * Test the methods splitData and getLOOByUser * * @throws Exception */ @Test public void test01LOOByUser() throws Exception{ conf.set("data.splitter.loocv", "user"); convertor.processData(); LOOCVDataSplitter splitter = new LOOCVDataSplitter(convertor, conf); splitter.splitData(); assertEquals(splitter.getTrainData().size(), 9); assertEquals(splitter.getTestData().size(), 4); } /** * Test the methods splitData and getLOOByItem * * @throws Exception */ @Test public void test02LOOByItem() throws Exception{ conf.set("data.splitter.loocv", "item"); convertor.processData(); LOOCVDataSplitter splitter = new LOOCVDataSplitter(convertor, conf); splitter.splitData(); assertEquals(splitter.getTrainData().size(), 9); assertEquals(splitter.getTestData().size(), 4); } /** * Test the methods splitData and getLOOByUserDate * * @throws Exception */ @Test public void test03LOOByUserDate() throws Exception{ conf.set("data.splitter.loocv", "userdate"); convertorWithDate.processData(); LOOCVDataSplitter splitter = new LOOCVDataSplitter(convertorWithDate, conf); splitter.splitData(); assertEquals(splitter.getTrainData().size(), 9); assertEquals(splitter.getTestData().size(), 4); } /** * Test the methods splitData and getLOOByItemDate * * @throws Exception */ @Test public void test04LOOByItemDate() throws Exception{ conf.set("data.splitter.loocv", "itemdate"); convertorWithDate.processData(); LOOCVDataSplitter splitter = new LOOCVDataSplitter(convertorWithDate, conf); splitter.splitData(); assertEquals(splitter.getTrainData().size(), 9); assertEquals(splitter.getTestData().size(), 4); } // public void testLOOByRate() throws Exception { // conf.set("data.splitter.loocv", "rate"); // convertor.processData(); // LOOCVDataSplitter splitter = new LOOCVDataSplitter(convertor, conf); // for (int i = 1; i <= conf.getInt("data.splitter.cv.number"); i ++) { // conf.setInt("data.splitter.cv.index", i); // splitter.splitData(); // assertEquals(splitter.getTrainData().size(), 12); // assertEquals(splitter.getTestData().size(), 1); // } // } }
30.686567
117
0.735895
b375dbc26f945bfab3e404dac8fc23dffea4c23f
3,849
package mat.client.event; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; /** * The Class CQLLibrarySelectedEvent. */ public class CQLLibrarySelectedEvent extends GwtEvent<CQLLibrarySelectedEvent.Handler> { /** The type. */ public static GwtEvent.Type<CQLLibrarySelectedEvent.Handler> TYPE = new GwtEvent.Type<CQLLibrarySelectedEvent.Handler>(); /** * The Interface Handler. */ public static interface Handler extends EventHandler { /** * On CQLLibrary selected. * * @param event * the event */ public void onLibrarySelected(CQLLibrarySelectedEvent event); } private String cqlLibraryId; private String libraryName; private boolean isEditable; private boolean isLocked; private String lockedUserId; private String lockedUserEmail; private String lockedUserName; private String cqlLibraryVersion; private boolean isDraft; /** * Instantiates a new cql library selected event. */ public CQLLibrarySelectedEvent(String cqlLibraryId, String cqlLibraryVersion, String libraryName, boolean isEditable,boolean isLocked,String lockedUserId,String lockedUserEmail,String lockedUserName, boolean isDraft) { this.cqlLibraryId = cqlLibraryId; this.cqlLibraryVersion = cqlLibraryVersion; this.libraryName = libraryName; this.isEditable = isEditable; this.isLocked = isLocked; this.lockedUserId = lockedUserId; this.lockedUserEmail = lockedUserEmail; this.lockedUserName = lockedUserName; this.isDraft = isDraft; } /* (non-Javadoc) * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType() */ @Override public com.google.gwt.event.shared.GwtEvent.Type<Handler> getAssociatedType() { return TYPE; } /* (non-Javadoc) * @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler) */ @Override protected void dispatch(Handler handler) { handler.onLibrarySelected(this); } public String getCqlLibraryId() { return cqlLibraryId; } public void setCqlLibraryId(String cqlLibraryId) { this.cqlLibraryId = cqlLibraryId; } public String getLibraryName() { return libraryName; } public void setLibraryName(String libraryName) { this.libraryName = libraryName; } public String getCqlLibraryVersion() { return cqlLibraryVersion; } public void setCqlLibraryVersion(String cqlLibraryVersion) { this.cqlLibraryVersion = cqlLibraryVersion; } /** * Checks if is editable. * * @return true, if is editable */ public boolean isEditable() { return isEditable; } /** * Gets the locked user id. * * @return the locked user id */ public String getLockedUserId() { return lockedUserId; } /** * Sets the locked user id. * * @param lockedUserId * the new locked user id */ public void setLockedUserId(String lockedUserId) { this.lockedUserId = lockedUserId; } /** * Sets the editable. * * @param isEditable * the new editable */ public void setEditable(boolean isEditable) { this.isEditable = isEditable; } /** * Checks if is locked. * * @return true, if is locked */ public boolean isLocked() { return isLocked; } /** * Sets the locked. * * @param isLocked * the new locked */ public void setLocked(boolean isLocked) { this.isLocked = isLocked; } public String getLockedUserEmail() { return lockedUserEmail; } public void setLockedUserEmail(String lockedUserEmail) { this.lockedUserEmail = lockedUserEmail; } public String getLockedUserName() { return lockedUserName; } public void setLockedUserName(String lockedUserName) { this.lockedUserName = lockedUserName; } public boolean isDraft() { return isDraft; } public void setDraft(boolean isDraft) { this.isDraft = isDraft; } }
20.473404
220
0.717069
aae10e0300fe355b8e50d84cf39bd5490b5ded79
9,568
package io.connectedhealth_idaas.eventbuilder.dataobjects.clinical.hl7; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; public class PRB { private String PRB_1_ActionCode; private String PRB_2_ActionDateTime; private String PRB_3_ProblemID; private String PRB_4_ProblemInstanceID; private String PRB_5_EpisodeofCareID; private String PRB_6_ProblemListPriority; private String PRB_7_ProblemEstablishedDateTime; private String PRB_8_AnticipatedProblemResolutionDateTime; private String PRB_9_ActualProblemResolutionDateTime; private String PRB_10_ProblemClassification; private String PRB_11_ProblemManagementDiscipline; private String PRB_12_ProblemPersistence; private String PRB_13_ProblemConfirmationStatus; private String PRB_14_ProblemLifeCycleStatus; private String PRB_15_ProblemLifeCycleStatusDateTime; private String PRB_16_ProblemDateofOnset; private String PRB_17_ProblemOnsetText; private String PRB_18_ProblemRanking; private String PRB_19_CertaintyofProblem; private String PRB_20_ProbabilityofProblem01; private String PRB_21_IndividualAwarenessofProblem; private String PRB_22_ProblemPrognosis; private String PRB_23_IndividualAwarenessofPrognosis; private String PRB_24_FamilySignificantOtherAwarenessofProblemPrognosis; private String PRB_25_SecuritySensitivity; private String PRB_26_ProblemSeverity; private String PRB_27_ProblemPerspective; private String PRB_28_MoodCode; public String getPRB_1_ActionCode() { return this.PRB_1_ActionCode; } public void setPRB_1_ActionCode(final String PRB_1_ActionCode) { this.PRB_1_ActionCode = PRB_1_ActionCode; } public String getPRB_2_ActionDateTime() { return this.PRB_2_ActionDateTime; } public void setPRB_2_ActionDateTime(final String PRB_2_ActionDateTime) { this.PRB_2_ActionDateTime = PRB_2_ActionDateTime; } public String getPRB_3_ProblemID() { return this.PRB_3_ProblemID; } public void setPRB_3_ProblemID(final String PRB_3_ProblemID) { this.PRB_3_ProblemID = PRB_3_ProblemID; } public String getPRB_4_ProblemInstanceID() { return this.PRB_4_ProblemInstanceID; } public void setPRB_4_ProblemInstanceID(final String PRB_4_ProblemInstanceID) { this.PRB_4_ProblemInstanceID = PRB_4_ProblemInstanceID; } public String getPRB_5_EpisodeofCareID() { return this.PRB_5_EpisodeofCareID; } public void setPRB_5_EpisodeofCareID(final String PRB_5_EpisodeofCareID) { this.PRB_5_EpisodeofCareID = PRB_5_EpisodeofCareID; } public String getPRB_6_ProblemListPriority() { return this.PRB_6_ProblemListPriority; } public void setPRB_6_ProblemListPriority(final String PRB_6_ProblemListPriority) { this.PRB_6_ProblemListPriority = PRB_6_ProblemListPriority; } public String getPRB_7_ProblemEstablishedDateTime() { return this.PRB_7_ProblemEstablishedDateTime; } public void setPRB_7_ProblemEstablishedDateTime(final String PRB_7_ProblemEstablishedDateTime) { this.PRB_7_ProblemEstablishedDateTime = PRB_7_ProblemEstablishedDateTime; } public String getPRB_8_AnticipatedProblemResolutionDateTime() { return this.PRB_8_AnticipatedProblemResolutionDateTime; } public void setPRB_8_AnticipatedProblemResolutionDateTime(final String PRB_8_AnticipatedProblemResolutionDateTime) { this.PRB_8_AnticipatedProblemResolutionDateTime = PRB_8_AnticipatedProblemResolutionDateTime; } public String getPRB_9_ActualProblemResolutionDateTime() { return this.PRB_9_ActualProblemResolutionDateTime; } public void setPRB_9_ActualProblemResolutionDateTime(final String PRB_9_ActualProblemResolutionDateTime) { this.PRB_9_ActualProblemResolutionDateTime = PRB_9_ActualProblemResolutionDateTime; } public String getPRB_10_ProblemClassification() { return this.PRB_10_ProblemClassification; } public void setPRB_10_ProblemClassification(final String PRB_10_ProblemClassification) { this.PRB_10_ProblemClassification = PRB_10_ProblemClassification; } public String getPRB_11_ProblemManagementDiscipline() { return this.PRB_11_ProblemManagementDiscipline; } public void setPRB_11_ProblemManagementDiscipline(final String PRB_11_ProblemManagementDiscipline) { this.PRB_11_ProblemManagementDiscipline = PRB_11_ProblemManagementDiscipline; } public String getPRB_12_ProblemPersistence() { return this.PRB_12_ProblemPersistence; } public void setPRB_12_ProblemPersistence(final String PRB_12_ProblemPersistence) { this.PRB_12_ProblemPersistence = PRB_12_ProblemPersistence; } public String getPRB_13_ProblemConfirmationStatus() { return this.PRB_13_ProblemConfirmationStatus; } public void setPRB_13_ProblemConfirmationStatus(final String PRB_13_ProblemConfirmationStatus) { this.PRB_13_ProblemConfirmationStatus = PRB_13_ProblemConfirmationStatus; } public String getPRB_14_ProblemLifeCycleStatus() { return this.PRB_14_ProblemLifeCycleStatus; } public void setPRB_14_ProblemLifeCycleStatus(final String PRB_14_ProblemLifeCycleStatus) { this.PRB_14_ProblemLifeCycleStatus = PRB_14_ProblemLifeCycleStatus; } public String getPRB_15_ProblemLifeCycleStatusDateTime() { return this.PRB_15_ProblemLifeCycleStatusDateTime; } public void setPRB_15_ProblemLifeCycleStatusDateTime(final String PRB_15_ProblemLifeCycleStatusDateTime) { this.PRB_15_ProblemLifeCycleStatusDateTime = PRB_15_ProblemLifeCycleStatusDateTime; } public String getPRB_16_ProblemDateofOnset() { return this.PRB_16_ProblemDateofOnset; } public void setPRB_16_ProblemDateofOnset(final String PRB_16_ProblemDateofOnset) { this.PRB_16_ProblemDateofOnset = PRB_16_ProblemDateofOnset; } public String getPRB_17_ProblemOnsetText() { return this.PRB_17_ProblemOnsetText; } public void setPRB_17_ProblemOnsetText(final String PRB_17_ProblemOnsetText) { this.PRB_17_ProblemOnsetText = PRB_17_ProblemOnsetText; } public String getPRB_18_ProblemRanking() { return this.PRB_18_ProblemRanking; } public void setPRB_18_ProblemRanking(final String PRB_18_ProblemRanking) { this.PRB_18_ProblemRanking = PRB_18_ProblemRanking; } public String getPRB_19_CertaintyofProblem() { return this.PRB_19_CertaintyofProblem; } public void setPRB_19_CertaintyofProblem(final String PRB_19_CertaintyofProblem) { this.PRB_19_CertaintyofProblem = PRB_19_CertaintyofProblem; } public String getPRB_20_ProbabilityofProblem01() { return this.PRB_20_ProbabilityofProblem01; } public void setPRB_20_ProbabilityofProblem01(final String PRB_20_ProbabilityofProblem01) { this.PRB_20_ProbabilityofProblem01 = PRB_20_ProbabilityofProblem01; } public String getPRB_21_IndividualAwarenessofProblem() { return this.PRB_21_IndividualAwarenessofProblem; } public void setPRB_21_IndividualAwarenessofProblem(final String PRB_21_IndividualAwarenessofProblem) { this.PRB_21_IndividualAwarenessofProblem = PRB_21_IndividualAwarenessofProblem; } public String getPRB_22_ProblemPrognosis() { return this.PRB_22_ProblemPrognosis; } public void setPRB_22_ProblemPrognosis(final String PRB_22_ProblemPrognosis) { this.PRB_22_ProblemPrognosis = PRB_22_ProblemPrognosis; } public String getPRB_23_IndividualAwarenessofPrognosis() { return this.PRB_23_IndividualAwarenessofPrognosis; } public void setPRB_23_IndividualAwarenessofPrognosis(final String PRB_23_IndividualAwarenessofPrognosis) { this.PRB_23_IndividualAwarenessofPrognosis = PRB_23_IndividualAwarenessofPrognosis; } public String getPRB_24_FamilySignificantOtherAwarenessofProblemPrognosis() { return this.PRB_24_FamilySignificantOtherAwarenessofProblemPrognosis; } public void setPRB_24_FamilySignificantOtherAwarenessofProblemPrognosis(final String PRB_24_FamilySignificantOtherAwarenessofProblemPrognosis) { this.PRB_24_FamilySignificantOtherAwarenessofProblemPrognosis = PRB_24_FamilySignificantOtherAwarenessofProblemPrognosis; } public String getPRB_25_SecuritySensitivity() { return this.PRB_25_SecuritySensitivity; } public void setPRB_25_SecuritySensitivity(final String PRB_25_SecuritySensitivity) { this.PRB_25_SecuritySensitivity = PRB_25_SecuritySensitivity; } public String getPRB_26_ProblemSeverity() { return this.PRB_26_ProblemSeverity; } public void setPRB_26_ProblemSeverity(final String PRB_26_ProblemSeverity) { this.PRB_26_ProblemSeverity = PRB_26_ProblemSeverity; } public String getPRB_27_ProblemPerspective() { return this.PRB_27_ProblemPerspective; } public void setPRB_27_ProblemPerspective(final String PRB_27_ProblemPerspective) { this.PRB_27_ProblemPerspective = PRB_27_ProblemPerspective; } public String getPRB_28_MoodCode() { return this.PRB_28_MoodCode; } public void setPRB_28_MoodCode(final String PRB_28_MoodCode) { this.PRB_28_MoodCode = PRB_28_MoodCode; } public String toString() { return ReflectionToStringBuilder.toString(this); } }
36.242424
148
0.783236
9324deb01cdfc49285b01570e3569b9dca02e8ad
248
package com.safety.service; import java.util.List; public interface IDetailService<T> { public T getDetailById(int id); public List<T> getAllDetail(); public void save(T detail); public void update(T detail); public void delete(T detail); }
20.666667
36
0.75
57e89175d3dcef838a1508b91c5c2dc70dd829bb
12,101
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.thespheres.betula.admin.database.configui; import java.io.IOException; import java.net.URI; import java.text.Collator; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.SortedSet; import java.util.StringJoiner; import java.util.TreeSet; import javax.swing.Action; import org.openide.awt.Actions; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; import org.openide.util.lookup.Lookups; import org.thespheres.betula.adminconfig.AppResourcesProperties; import org.thespheres.betula.admin.database.configui.AppResourcesFileChildren.Entry; import org.thespheres.betula.services.LocalProperties; import org.thespheres.betula.services.NoProviderException; import org.thespheres.betula.services.WebProvider; import org.thespheres.betula.services.client.jms.JMSListener; import org.thespheres.betula.services.client.jms.JMSTopicListenerService; import org.thespheres.betula.services.dav.DAVProp; import org.thespheres.betula.services.dav.DisplayName; import org.thespheres.betula.services.dav.GetLastModified; import org.thespheres.betula.services.dav.Multistatus; import org.thespheres.betula.services.dav.PropStat; import org.thespheres.betula.services.dav.ResourceType; import org.thespheres.betula.services.dav.Response; import org.thespheres.betula.services.jms.AppResourceEvent; import org.thespheres.betula.services.jms.JMSTopic; import org.thespheres.betula.services.ui.ConfigurationException; import org.thespheres.betula.services.ui.util.HttpUtilities; import org.thespheres.betula.services.ui.util.dav.URLs; import org.thespheres.betula.util.CollectionUtil; /** * * @author boris */ public class AppResourcesFileChildren extends ChildFactory<Entry> { static Collator COLLATOR = Collator.getInstance(Locale.getDefault()); protected final Entry dir; AppResourcesFileChildren(final Entry dir) { this.dir = dir; } public static AppResourcesFileChildren createRoot(final String provider) { class Root extends AppResourcesFileChildren implements Runnable, JMSListener<AppResourceEvent> { final RequestProcessor RP = new RequestProcessor(AppResourcesProperties.class.getCanonicalName(), 1, true); private final RequestProcessor.Task loadTask; @SuppressWarnings({"LeakingThisInConstructor"}) Root() { super(new Entry("", null, true, provider)); loadTask = RP.create(this); loadTask.schedule(0); } @Override public void run() { try { final String davBase = URLs.adminResourcesDavBase(LocalProperties.find(provider)); final WebProvider service = WebProvider.find(provider, WebProvider.class); final URI uri = URI.create(davBase); readDirectories(service, uri, dir); } catch (IOException ex) { Exceptions.printStackTrace(ex); } finally { refresh(false); } } @Override public void addNotify() { } @Override public void removeNotify() { } @Override public void onMessage(final AppResourceEvent event) { loadTask.schedule(1500); } } final Root root = new Root(); final JMSTopicListenerService jms = JMSTopicListenerService.find(provider, JMSTopic.APP_RESOURCES_TOPIC.getJmsResource()); if (jms != null) { jms.registerListener(AppResourceEvent.class, root); } return root; } static Map<String, String> readDirectories(final WebProvider wp, final URI uri, final Entry root) throws IOException { try { final Multistatus ms = HttpUtilities.getProperties(wp, uri, -1, true); final Map<String, String> ret = new HashMap<>(); synchronized (root) { root.folderChildren.clear(); root.fileChildren.clear(); parseMultistatus(ms, root); } return ret; } catch (NoProviderException | ConfigurationException ex) { throw new IOException(ex); } } private static void parseMultistatus(final Multistatus ms, final Entry root) throws IOException { responses: for (final Response r : ms.getResponses()) { final String href = r.getHref().stream() .collect(CollectionUtil.singleOrNull()); if (href == null) { continue; } final String path = href.substring("/web/dav/".length()); for (final PropStat ps : r.getPropstat()) { if (ps.getStatusCode() == 200) { final DAVProp prop = (DAVProp) ps.getProp(); final boolean folder = Optional.ofNullable(prop.getResourcetype()) .map(ResourceType::getCollection) .isPresent(); final String name = Optional.ofNullable(prop.getDisplayName()) .map(DisplayName::getValue) .orElse(null); if (name != null) { final Entry dir; final int li = path.lastIndexOf('/'); if (li == -1) { dir = root; } else { Entry ce = root; int i = -1; while ((i = path.indexOf('/', i + 1)) != -1) { final String sp = path.substring(0, i + 1); final Entry found = ce.folderChildren.stream() .filter(fc -> fc.getResourcePath().equals(sp)) .collect(CollectionUtil.requireSingleOrNull()); if (found != null) { ce = found; } else { ce = ce.addFolderEntry(sp); } } dir = ce; } if (dir == null) { throw new IOException(); } if (folder) { dir.setName(name); continue responses; } else { final String lm = Optional.ofNullable(prop.getGetLastModified()) .map(GetLastModified::getValue) .orElse(null); dir.addFileEntry(path, name, lm); continue responses; } } } } } } @Override protected boolean createKeys(final List<Entry> list) { synchronized (dir) { dir.folderChildren.forEach(list::add); dir.fileChildren.forEach(list::add); } return true; } @Override protected Node createNodeForKey(final Entry key) { if (key.isFolder()) { return new FolderNode(key); } else { return new FileNode(key); } } static class FolderNode extends AbstractNode { public FolderNode(final Entry e) { super(Children.create(new AppResourcesFileChildren(e), true), Lookups.fixed(e)); setName(e.getName()); setIconBaseWithExtension("org/thespheres/betula/admin/database/resources/blue-folder-horizontal.png"); } @Override public Action[] getActions(boolean context) { final Action ua = Actions.forID("Tools", "org.thespheres.betula.admin.database.configui.UploadAction"); return new Action[]{ua}; } } static class FileNode extends AbstractNode { private final Entry entry; FileNode(final Entry e) { super(Children.LEAF, Lookups.fixed(e)); this.entry = e; setName(e.getName()); setIconBaseWithExtension("org/thespheres/betula/admin/database/resources/document-import.png"); } @Override public Action getPreferredAction() { return Actions.forID("Tools", "org.thespheres.betula.admin.database.configui.DownloadAction"); } @Override public String getHtmlDisplayName() { final StringJoiner sj = new StringJoiner(" ", "<html>", "</html>"); sj.add(getName()); if (entry.getLastModified() != null) { sj.add("<font color='D3D3D3'><i>[" + entry.getLastModified() + "]</i></font>"); } return sj.toString(); } } protected static class Entry implements Comparable<Entry> { final String resourcePath; final String provider; String name; final boolean folder; String lastModified; final SortedSet<Entry> folderChildren = new TreeSet<>(); final SortedSet<Entry> fileChildren = new TreeSet<>(); Entry(final String path, final String name, final boolean folder, final String provider) { this.resourcePath = path; this.name = name; this.folder = folder; this.provider = provider; } String getResourcePath() { return resourcePath; } String getName() { return name; } void setName(String name) { this.name = name; } boolean isFolder() { return folder; } String getProvider() { return provider; } String getLastModified() { return lastModified; } void setLastModified(String lastModified) { this.lastModified = lastModified; } void addFileEntry(final String path, final String name, final String lastModified) { final Entry entry = new Entry(path, name, false, provider); entry.setLastModified(lastModified); fileChildren.add(entry); } Entry addFolderEntry(final String path) { final Entry entry = new Entry(path, "", true, provider); folderChildren.add(entry); return entry; } @Override public int compareTo(final Entry other) { return COLLATOR.compare(name, other.name); } @Override public int hashCode() { int hash = 7; hash = 79 * hash + Objects.hashCode(this.resourcePath); hash = 79 * hash + (this.folder ? 1 : 0); return 79 * hash + Objects.hashCode(this.lastModified); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Entry other = (Entry) obj; if (this.folder != other.folder) { return false; } if (!Objects.equals(this.resourcePath, other.resourcePath)) { return false; } return Objects.equals(this.lastModified, other.lastModified); } } }
35.591176
130
0.557061
307fbd8f75eb0bc4bddd6be9ec898bf633dc4051
102
public class Hello { private static final int a = 42; public int getA() { return a; } }
11.333333
34
0.588235
70273b77e9ee958bcb6cc018bdb76d78a40a3570
2,987
package org.spongycastle.asn1.x509; import org.spongycastle.asn1.ASN1EncodableVector; import org.spongycastle.asn1.ASN1Object; import org.spongycastle.asn1.ASN1ObjectIdentifier; import org.spongycastle.asn1.ASN1Primitive; import org.spongycastle.asn1.ASN1Sequence; import org.spongycastle.asn1.DERSequence; public class PolicyInformation extends ASN1Object { private ASN1ObjectIdentifier policyIdentifier; private ASN1Sequence policyQualifiers; private PolicyInformation( ASN1Sequence seq) { if (seq.size() < 1 || seq.size() > 2) { throw new IllegalArgumentException("Bad sequence size: " + seq.size()); } policyIdentifier = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0)); if (seq.size() > 1) { policyQualifiers = ASN1Sequence.getInstance(seq.getObjectAt(1)); } } public PolicyInformation( ASN1ObjectIdentifier policyIdentifier) { this.policyIdentifier = policyIdentifier; } public PolicyInformation( ASN1ObjectIdentifier policyIdentifier, ASN1Sequence policyQualifiers) { this.policyIdentifier = policyIdentifier; this.policyQualifiers = policyQualifiers; } public static PolicyInformation getInstance( Object obj) { if (obj == null || obj instanceof PolicyInformation) { return (PolicyInformation)obj; } return new PolicyInformation(ASN1Sequence.getInstance(obj)); } public ASN1ObjectIdentifier getPolicyIdentifier() { return policyIdentifier; } public ASN1Sequence getPolicyQualifiers() { return policyQualifiers; } /* * <pre> * PolicyInformation ::= SEQUENCE { * policyIdentifier CertPolicyId, * policyQualifiers SEQUENCE SIZE (1..MAX) OF * PolicyQualifierInfo OPTIONAL } * </pre> */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(policyIdentifier); if (policyQualifiers != null) { v.add(policyQualifiers); } return new DERSequence(v); } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Policy information: "); sb.append(policyIdentifier); if (policyQualifiers != null) { StringBuffer p = new StringBuffer(); for (int i = 0; i < policyQualifiers.size(); i++) { if (p.length() != 0) { p.append(", "); } p.append(PolicyQualifierInfo.getInstance(policyQualifiers.getObjectAt(i))); } sb.append("["); sb.append(p); sb.append("]"); } return sb.toString(); } }
25.529915
91
0.586207
1db07d570b568a3d6f0c5a33b1eb864baae4b4dc
455
package com.bahadirmemis.springboot.dao; import com.bahadirmemis.springboot.entity.ProductComment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface ProductCommentDao extends JpaRepository<ProductComment,Long> { List<ProductComment> findAllByUser_Id(Long userId); List<ProductComment> findAllByProduct_Id(Long productId); }
22.75
79
0.826374
627590950b7896f8f5ed95180737d6b6084f9915
881
package com.test.memento; /** * @Author: zhouguanya * @Date: 2019/02/07 * @Description: 备忘录模式测试类 */ public class MementoPatternDemo { public static void main(String[] args) { Original original = new Original(); StateKeeper keeper = new StateKeeper(); original.setState("State 1"); keeper.addState(original.saveMementoState()); //状态变更 original.setState("State 2"); keeper.addState(original.saveMementoState()); //状态变更 original.setState("State 3"); System.out.println("Current State is :" + original.getState()); //第1次保存的状态 original.getMementoState(keeper.get(0)); System.out.println("Initial State: " + original.getState()); //第2次保存的状态 original.getMementoState(keeper.get(1)); System.out.println("Second State: " + original.getState()); } }
31.464286
71
0.624291
1a4e49b658d31ae54904451bfa98ff1779ef6e30
496
package io.github.scottleedavis.mattermost.remind.db; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; import java.util.List; public interface ReminderOccurrenceRepository extends JpaRepository<ReminderOccurrence, Long> { List<ReminderOccurrence> findAllByOccurrence(LocalDateTime localDateTime); List<ReminderOccurrence> findAllByReminder(Reminder reminder); List<ReminderOccurrence> findAllBySnoozed(LocalDateTime localDateTime); }
33.066667
95
0.83871
dcbfbb72c6f3dcdcdf1d38f335eaa6e02aed0f61
1,126
//generated by abstract-syntax-gen package notquitejava.ast; import java.util.*; public interface NQJOperator extends NQJElement{ NQJElement getParent(); <T> T match(Matcher<T> s); void match(MatcherVoid s); public interface Matcher<T> { T case_Minus(NQJMinus minus); T case_Div(NQJDiv div); T case_And(NQJAnd and); T case_Less(NQJLess less); T case_Times(NQJTimes times); T case_Plus(NQJPlus plus); T case_Equals(NQJEquals equals); } public interface MatcherVoid { void case_Minus(NQJMinus minus); void case_Div(NQJDiv div); void case_And(NQJAnd and); void case_Less(NQJLess less); void case_Times(NQJTimes times); void case_Plus(NQJPlus plus); void case_Equals(NQJEquals equals); } NQJOperator copy(); NQJOperator copyWithRefs(); /** "information about the source code"*/ public abstract frontend.SourcePosition getSourcePosition(); /** "information about the source code"*/ public abstract void setSourcePosition(frontend.SourcePosition sourcePosition); }
31.277778
83
0.674067
a840c4ca13e3035f1f9157ab21db464912f1d88c
797
package com.microsoft.appcenter.assets.exceptions; /** * General code push exception that has no specified sub type or occasion. */ public class AssetsGeneralException extends Exception { /** * Creates an instance of {@link AssetsGeneralException} with custom message and exception provided. * * @param detailMessage custom message. * @param throwable cause of the exception. */ public AssetsGeneralException(String detailMessage, Throwable throwable) { super(detailMessage, throwable); } /** * Creates an instance of {@link AssetsGeneralException} with custom message provided. * * @param detailMessage custom message. */ public AssetsGeneralException(String detailMessage) { super(detailMessage); } }
29.518519
104
0.697616
11a7e99cb25c4e795cea8f8e9addb78db3a54c00
1,320
package kg.apc.logging; import org.apache.jorphan.logging.LoggingManager; import org.apache.log.Logger; import java.lang.reflect.Constructor; public class LoggingUtils { private static final Logger log = LoggingManager.getLoggerForClass(); public static void addLoggingConfig() { if (isJMeter32orLater()) { configureCMDLogging(); } } private static void configureCMDLogging() { try { Class cls = Class.forName("kg.apc.logging.LoggingConfigurator"); Constructor constructor = cls.getConstructor(); constructor.newInstance(); } catch (Throwable ex) { System.out.println("Fail to configure logging " + ex.getMessage()); ex.printStackTrace(System.out); } } public static boolean isJMeter32orLater() { try { Class<?> cls = LoggingUtils.class.getClassLoader().loadClass("org.apache.jmeter.gui.logging.GuiLogEventBus"); if (cls != null) { return true; } } catch (ClassNotFoundException ex) { log.debug("Class 'org.apache.jmeter.gui.logging.GuiLogEventBus' not found", ex); } catch (Throwable ex) { log.warn("Fail to detect JMeter version", ex); } return false; } }
31.428571
121
0.612879
5db3e44aafc8f8a173a7e76bb01c366f2e6ddfa6
1,699
package com.google.android.gms.common; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.os.Bundle; import com.google.android.gms.common.internal.Preconditions; public class ErrorDialogFragment extends DialogFragment { private Dialog mDialog = null; private OnCancelListener zaan = null; public Dialog onCreateDialog(Bundle bundle) { if (this.mDialog == null) { setShowsDialog(false); } return this.mDialog; } public void onCancel(DialogInterface dialogInterface) { OnCancelListener onCancelListener = this.zaan; if (onCancelListener != null) { onCancelListener.onCancel(dialogInterface); } } public static ErrorDialogFragment newInstance(Dialog dialog) { return newInstance(dialog, null); } public static ErrorDialogFragment newInstance(Dialog dialog, OnCancelListener onCancelListener) { ErrorDialogFragment errorDialogFragment = new ErrorDialogFragment(); Dialog dialog2 = (Dialog) Preconditions.checkNotNull(dialog, "Cannot display null dialog"); dialog2.setOnCancelListener(null); dialog2.setOnDismissListener(null); errorDialogFragment.mDialog = dialog2; if (onCancelListener != null) { errorDialogFragment.zaan = onCancelListener; } return errorDialogFragment; } public void show(FragmentManager fragmentManager, String str) { super.show(fragmentManager, str); } }
34.673469
102
0.694526
6db48e7c7e4c3b23da6cef8753709570203f9848
1,265
package lab.spring.ResourceServerApplication; import java.util.Arrays; import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; public class CommonWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { @Override public void configure(HttpSecurity http) throws Exception { http // .cors() // .and() // .antMatcher("/**") // .authorizeRequests() // .antMatchers("/public") // .permitAll() // .anyRequest() // .authenticated(); } @Bean CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowedOrigins(Arrays.asList("http://trustedhost")); configuration.setAllowedMethods(Arrays.asList("GET", "POST")); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); return source; } }
34.189189
101
0.783399
60618e7e7b77be59fd81a06f639246029c8006e8
5,980
/********************************************************************************* * Copyright 2016-present trivago GmbH * * 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.trivago.examples; import java.io.IOException; import java.io.PrintStream; import javax.cache.CacheManager; import javax.cache.Caching; import javax.cache.configuration.MutableConfiguration; import javax.cache.spi.CachingProvider; import com.trivago.triava.tcache.Cache; import com.trivago.triava.tcache.TCacheFactory; import com.trivago.triava.tcache.TCacheHolder; import com.trivago.triava.tcache.core.Builder; import com.trivago.triava.tcache.eviction.FreezingEvictor; /** * Examples for creating a Cache using the Java Caching API (JSR107). This example shows basic operations like * creating a Cache, put and get. Additionally it does an introduction into the Cache statistics, available via * MBean or a native tCache statistics object. * * @author cesken * */ public class CacheJSR107Example { PrintStream out = System.out; CacheManager cacheManager; String cacheName = "simpleCache"; String cacheName2 = "builderCache"; int elementsToWrite = 20_000; public static void main(String[] args) { new CacheJSR107Example().example(); } void example() { out.println("Test for a stock JSR107 Cache"); runTest(createJsr107Cache(cacheName)); out.println(); out.println("Test for a JSR107 Cache, using a Builder as Configuration object"); runTest(createJsr107CacheWithBuilder(cacheName2)); } void runTest(javax.cache.Cache<Integer, Integer> cache) { out.println("Created Cache: " + cache); int countGood = 0; int countBad = 0; for (int i = 1; i <= elementsToWrite; i++) { cache.put(i, i + 1); if (i % 1000 == 0) { out.println("Written " + i + " entries"); } // Each 10th loop iteration, do a get if (i % 10 == 0) { // The following will create a 60% hit ratio in the statistics if (i % 30 == 0) { // entering for i in 0,30,60,90 cache.get(i + 5); countBad++; } else { // entering for i in 10,20,40,50,70,80 cache.get(i); countGood++; } } } float expectedHitRate = countGood / ((float)countGood + countBad); out.println("Use JVisualVM or any other tool to inspect the MBeans in javax.cache"); out.println(); // For demonstrating the two statistics (native and JSR107 MBean), we need to access the native tCache implementation => unwrap Cache<?,?> tcache = cache.unwrap(Cache.class); out.println(tcache.statistics()); out.println(); out.println("The statistics in the MBeans should match the one above execpt for different naming and the 'hit rate':"); out.println(" - hitRatio is the last minute average (floating average, tCache specific, always 0.0% in the first 10 seconds)"); out.println(" - The CacheHitPercentage in the MBean is an overall value, as defined in JSR107"); out.println(" - The theoretically expected hit rate is " + 100*expectedHitRate + "%"); out.println("Press return to continue"); waitForCR(); out.println("Destroying cache"); cacheManager.destroyCache(cache.getName()); out.println("MBeans should be unregistered now. Press return to continue"); waitForCR(); } /** * Wait for CR (actually ANYKEY) and return. */ private void waitForCR() { try { int readByte; do { readByte = System.in.read(); } while (readByte != 10); } catch (IOException e1) { } } /** * Creates a Cache via plain JSR107 API. The Cache is configured with a default MutableConfiguration. * @param cacheName Cache name * @return The Cache */ javax.cache.Cache<Integer, Integer> createJsr107Cache(String cacheName) { // Build JSR107 Cache instance CachingProvider cachingProvider = Caching.getCachingProvider(); cacheManager = cachingProvider.getCacheManager(); MutableConfiguration<Integer, Integer> mc = new MutableConfiguration<Integer, Integer>(); mc.setManagementEnabled(true); mc.setStatisticsEnabled(true); javax.cache.Cache<Integer, Integer> cache = cacheManager.createCache(cacheName, mc); // Build return cache; } /** * Creates a Cache via JSR107 API, but an extended Configuration object. Namely a tCache Builder is used, that extends the JSR107 Configuration. * * @param cacheName Cache name * @return The Cache */ javax.cache.Cache<Integer, Integer> createJsr107CacheWithBuilder(String cacheName) { // Build JSR107 Cache instance CachingProvider cachingProvider = Caching.getCachingProvider(); cacheManager = cachingProvider.getCacheManager(); // Get a Builder from the native CacheManager implementation TCacheFactory cacheFactory = cacheManager.unwrap(TCacheFactory.class); Builder<Integer, Integer> builder = cacheFactory.builder(); builder.setEvictionClass(new EvictByNumber()); // As Builder extends Configuration, it can be directly used in the JSR107 createCache() call javax.cache.Cache<Integer, Integer> cache = cacheManager.createCache(cacheName, builder); // Build cacheManager.enableManagement(cacheName, true); return cache; } static class EvictByNumber extends FreezingEvictor<Integer, Integer> { private static final long serialVersionUID = 1160605918585343273L; @Override public long getFreezeValue(Integer key, TCacheHolder<Integer> holder) { return key.longValue(); } } }
31.640212
145
0.702341
302cb1077148c48170202d02fe0e9dbd350594c4
3,107
package com.statful.collector; import com.statful.client.StatfulMetricsOptions; import com.statful.metric.PoolDataPoint; import com.statful.sender.Sender; import io.vertx.core.Vertx; import io.vertx.core.spi.metrics.PoolMetrics; import javax.annotation.Nonnull; import java.util.concurrent.atomic.LongAdder; /** * Handle Pools metrics */ public class PoolMetricsImpl extends StatfulMetrics implements PoolMetrics<Long> { /** * Long to store the current periodic id */ private long periodicTimerId; /** * Adder to keep counter of in use connections to the pool */ private LongAdder inUse = new LongAdder(); /** * Adder to keep counter of queued request to obtain a connection from the pool */ private LongAdder queued = new LongAdder(); /** * Stores maximum size of the pool */ private final String maxPoolSize; /** * Name for the pool */ private final String name; /** * Vertx instance to be used to create the period to flush gauges */ private Vertx vertx; /** * @param options options to latter be used by the metrics builder * @param poolType type of the pool * @param poolName name of the pool * @param maxPoolSize value of the maximum pool size */ public PoolMetricsImpl(@Nonnull final StatfulMetricsOptions options, @Nonnull final String poolType, @Nonnull final String poolName, final int maxPoolSize) { super(options); this.maxPoolSize = String.valueOf(maxPoolSize); this.name = poolType + "." + poolName; } @Override public Long submitted() { this.queued.increment(); return System.currentTimeMillis(); } @Override public Long begin(final Long aLong) { this.queued.decrement(); this.inUse.increment(); return System.currentTimeMillis(); } @Override public void rejected(final Long aLong) { this.queued.decrement(); } @Override public void end(final Long aLong, final boolean succeeded) { this.inUse.decrement(); } @Override public void close() { this.vertx.cancelTimer(this.periodicTimerId); } @Override public void setVertx(@Nonnull final Vertx vertx) { this.vertx = vertx; } @Override public void setSender(@Nonnull final Sender sender) { if (!this.hasSender()) { super.setSender(sender); this.initReporter(); } } private void initReporter() { this.periodicTimerId = this.vertx.setPeriodic(this.getOptions().getGaugeReportingInterval(), event -> { this.addMetric(new PoolDataPoint(this.getOptions(), name, "inUse", String.valueOf(this.inUse.longValue()))); this.addMetric(new PoolDataPoint(this.getOptions(), name, "queued", String.valueOf(this.queued.longValue()))); this.addMetric(new PoolDataPoint(this.getOptions(), name, "max", this.maxPoolSize)); }); } }
28.245455
122
0.633408
048e197585f19359183cf3b3588f5a7d681fe216
216
package com.gail.sps.dao; import java.util.List; import com.gail.sps.model.Product; public interface ProductDao extends GenericDao<Product, Integer> { public List<Integer> listHotProducts() throws Exception; }
18
66
0.782407
473c73309a6bccf7884cfc252d12003fa56dc944
334
package me.krizzdawg.ownerradius; import org.bukkit.entity.Player; public class Lang { /* * TODO Make this configurable in a lang.yml */ public static String INVALID_RADIUS = "&cInvalid radius '%input%'"; public static String RADIUS_TOO_LARGE = "&eThe radius your selected exceeded the maximum radius&l (%maxradius%)"; }
23.857143
114
0.736527
1e49a88e385d5154ac1bf89fa67613ee674656d1
4,370
/* * 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.karaf.instance.main; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.PrintStream; import java.io.IOException; import java.util.Properties; import junit.framework.TestCase; public class ExecuteTest extends TestCase { private String userDir; @Override protected void setUp() throws Exception { super.setUp(); Execute.exitAllowed = false; userDir = System.getProperty("user.dir"); } @Override protected void tearDown() throws Exception { super.tearDown(); Execute.exitAllowed = true; System.setProperty("user.dir", userDir); } public void testListCommands() throws Exception { PrintStream oldOut = System.out; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream capturedOut = new PrintStream(baos); System.setOut(capturedOut); try { Execute.main(new String [] {}); } catch (RuntimeException re) { assertEquals("0", re.getMessage()); String s = new String(baos.toByteArray()); assertTrue(s.contains("list")); assertTrue(s.contains("create")); assertTrue(s.contains("destroy")); } finally { System.setOut(oldOut); } } public void testNonexistingCommand() throws Exception { try { Execute.main(new String [] {"bheuaark"}); } catch (RuntimeException re) { assertEquals("-1", re.getMessage()); } } public void testNoStorageFile() throws Exception { PrintStream oldErr = System.err; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream capturedErr = new PrintStream(baos); System.setErr(capturedErr); try { Execute.main(new String [] {"create"}); } catch (RuntimeException re) { assertEquals("-2", re.getMessage()); String s = new String(baos.toByteArray()); assertTrue(s.contains("karaf.instances")); assertTrue(s.contains("instance.properties")); } finally { System.setErr(oldErr); } } public void testSetDir() throws Exception { Properties oldProps = (Properties) System.getProperties().clone(); final File tempFile = createTempDir(getName()); assertFalse("Precondition failed", tempFile.getParentFile().getParentFile().getCanonicalPath().equals(System.getProperty("user.dir"))); System.setProperty("karaf.instances", tempFile.getCanonicalPath()); try { Execute.main(new String [] {"list"}); assertTrue(tempFile.getParentFile().getParentFile().getCanonicalPath().equals(System.getProperty("user.dir"))); } finally { System.setProperties(oldProps); assertNull("Postcondition failed", System.getProperty("karaf.instances")); delete(tempFile); } } private static File createTempDir(String name) throws IOException { final File tempFile = File.createTempFile(name, null); tempFile.delete(); tempFile.mkdirs(); return tempFile.getCanonicalFile(); } private static void delete(File tmp) { if (tmp.isDirectory()) { for (File f : tmp.listFiles()) { delete(f); } } tmp.delete(); } }
34.409449
123
0.618078
0de4ff38baf1dea0c49d8cf778c0de710513ac3c
2,226
package matrixstudio.model; import fr.minibilles.basics.model.ChangeRecorder; import fr.minibilles.basics.serializer.Boost; /** * Parameter for simulation */ public class Parameter implements Named { private Model model; private String name; private String formula = ""; public Parameter() { } protected Parameter(Boost boost) { boost.register(this); model = boost.readObject(Model.class); name = boost.readString(); formula = boost.readString(); } /** * <p>Gets model.</p> */ public Model getModel() { return model; } /** * <p>Sets model.</p> */ public void setModel(Model newValue) { if (model == null ? newValue != null : (model.equals(newValue) == false)) { getChangeRecorder().recordChangeAttribute(this, "model", this.model); this.model= newValue; } } /** * <p>Gets formula.</p> */ public String getFormula() { return formula; } /** * <p>Sets formula.</p> */ public void setFormula(String newValue) { if (formula == null ? newValue != null : (formula.equals(newValue) == false)) { getChangeRecorder().recordChangeAttribute(this, "formula", this.formula); this.formula = newValue; } } /** * <p>Gets name.</p> */ public String getName() { return name; } /** * <p>Sets name.</p> */ public void setName(String newValue) { if (name == null ? newValue != null : (name.equals(newValue) == false)) { getChangeRecorder().recordChangeAttribute(this, "name", this.name); this.name= newValue; } } public void writeToBoost(Boost boost) { boost.writeObject(model); boost.writeString(name); boost.writeString(formula); } /** * Visitor accept method. */ public void accept(ModelVisitor visitor) { visitor.visitParameter(this); } public ChangeRecorder getChangeRecorder() { if ( getModel() != null ) { return getModel().getChangeRecorder(); } return ChangeRecorder.Stub; } }
22.26
87
0.562444
893d30753184833ae083547666f1b927624c18a2
4,287
package com.hbgc.springbootdemo.controller; import com.hbgc.springbootdemo.domain.BookMessage; import com.hbgc.springbootdemo.json.Json; import com.hbgc.springbootdemo.service.BookMessageService; import com.hbgc.springbootdemo.view.EbookView; import com.hbgc.springbootdemo.view.NoEbookView; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Map; @RestController @RequestMapping("bookmessage") public class BookMessageController extends BaseController { @Resource private BookMessageService bookMessageService; //根据类别查找图书信息 @GetMapping("/catalog") public Map<String,Object> queryBookByCatalog(int Cid){ List<BookMessage> bookMessageList=new ArrayList<BookMessage>(); try { bookMessageList=bookMessageService.queryBookMessagesByCid(Cid); return Json.success(bookMessageList,"查询书籍资料成功!"); } catch (Exception e) { e.printStackTrace(); return Json.fail("查询书籍资料失败!"); } } //查找所有图书信息 @GetMapping("/allbook") public Map<String,Object> queryAllBook(){ List<BookMessage> bookMessageList=new ArrayList<BookMessage>(); try { bookMessageList=bookMessageService.findAll(); return Json.success(bookMessageList,"查询所有书籍资料成功!"); } catch (Exception e) { e.printStackTrace(); return Json.fail("查询所有书籍资料失败!"); } } //根据图书名字查找图书信息 @GetMapping("/bookname") public Map<String,Object> queryBookByBookname(String bookname){ List<BookMessage> bookMessageList=new ArrayList<BookMessage>(); try { bookMessageList=bookMessageService.findBookMessagesByBooknameContaining(bookname); return Json.success(bookMessageList,"根据书名查找书籍成功!"); } catch (Exception e) { e.printStackTrace(); return Json.fail("根据书名查找书籍失败!"); } } //查询所有电子书的视图 @GetMapping("/ebook") public Map<String,Object> queryEbook(){ List<EbookView> ebookViewList=new ArrayList<EbookView>(); try { ebookViewList=bookMessageService.queryEbookView(); return Json.success(ebookViewList,"查找所有电子书成功"); } catch (Exception e) { e.printStackTrace(); return Json.fail("查找电子书失败"); } } //查询所有纸质书的视图 @GetMapping("/noebook") public Map<String,Object> queryNoEbook(){ List<NoEbookView> noEbookViewList=new ArrayList<NoEbookView>(); try { noEbookViewList=bookMessageService.queryNoEbookView(); return Json.success(noEbookViewList,"查找所有纸质书成功"); } catch (Exception e) { e.printStackTrace(); return Json.fail("查找所有纸质书失败"); } } //根据书名查询纸质书的视图 @GetMapping("/noebookbybookname") public Map<String,Object> queryNoEbookByBookname(String bookname){ List<NoEbookView> noEbookViewList=new ArrayList<NoEbookView>(); try { noEbookViewList=bookMessageService.queryNoeBookViewByBookname(bookname); return Json.success(noEbookViewList,"查找纸质书成功"); } catch (Exception e) { e.printStackTrace(); return Json.fail("查找纸质书失败"); } } //根据ID查找 @GetMapping("/bookmessageid") public Map<String,Object> queryBookById(int id){ try { BookMessage bookMessage=bookMessageService.queryById(id); return Json.success(bookMessage,"成功!"); } catch (Exception e) { e.printStackTrace(); return Json.fail("失败!"); } } //模糊查找 @GetMapping("/booknamelike") public Map<String,Object> queryBookByNameLike(String bookname){ List<BookMessage>bookMessageList=new ArrayList<BookMessage>(); try { bookMessageList=bookMessageService.findBookMessagesByBooknameContaining(bookname); return Json.success(bookMessageList,"成功!"); } catch (Exception e) { e.printStackTrace(); return Json.fail("失败!"); } } }
28.019608
94
0.651038
1757cd79fb9bb37ea18994af6a61df0ba91ffd4f
209,533
/* * This file was automatically generated by EvoSuite * Thu Dec 17 17:54:10 GMT 2015 */ package com.soops.CEN4010.JMCA.JParser; import static org.junit.Assert.*; import org.junit.Test; import com.soops.CEN4010.JMCA.JParser.JavaCharStream; import com.soops.CEN4010.JMCA.JParser.JavaParser; import com.soops.CEN4010.JMCA.JParser.JavaParserTokenManager; import com.soops.CEN4010.JMCA.JParser.Token; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.CharArrayReader; import java.io.FileDescriptor; import java.io.InputStream; import java.io.InputStreamReader; import java.io.LineNumberReader; import java.io.PipedInputStream; import java.io.PipedOutputStream; import java.io.PipedReader; import java.io.Reader; import java.io.SequenceInputStream; import java.io.StringBufferInputStream; import java.nio.charset.Charset; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.mock.java.io.MockFileReader; import org.evosuite.runtime.testdata.EvoSuiteFile; import org.evosuite.runtime.testdata.EvoSuiteLocalAddress; import org.evosuite.runtime.testdata.EvoSuiteRemoteAddress; import org.evosuite.runtime.testdata.EvoSuiteURL; import org.evosuite.runtime.testdata.FileSystemHandling; import org.evosuite.runtime.util.SystemInUtil; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true) public class JavaParser_ESTest extends JavaParser_ESTest_scaffolding { //Test case number: 0 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isProtected(I)Z: I8 Branch 3953 IFEQ L57 - false */ @Test public void test00() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isProtected(2019); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertTrue(boolean0); } //Test case number: 1 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.AssertStatement()V: I97 Branch 1732 IFEQ L4632 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.AssertStatement()V: I125 Branch 1733 IFEQ L4638 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.AssertStatement()V: I138 Branch 1734 IFEQ L4645 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.AssertStatement()V: I157 Branch 1735 IFEQ L4658 - true */ @Test public void test01() throws Throwable { JavaParser javaParser0 = new JavaParser(" , "); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.AssertStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 2 /* * 94 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I26 Branch 2875 IF_ICMPNE L6321 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2876 TABLESWITCH L6321 Case 15 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2877 TABLESWITCH L6321 Case 16 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2878 TABLESWITCH L6321 Case 17 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2879 TABLESWITCH L6321 Case 18 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2880 TABLESWITCH L6321 Case 19 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2881 TABLESWITCH L6321 Case 20 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2882 TABLESWITCH L6321 Case 21 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2883 TABLESWITCH L6321 Case 22 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2884 TABLESWITCH L6321 Case 23 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2885 TABLESWITCH L6321 Case 24 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2886 TABLESWITCH L6321 Case 25 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2887 TABLESWITCH L6321 Case 26 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2888 TABLESWITCH L6321 Case 27 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2889 TABLESWITCH L6321 Case 28 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2890 TABLESWITCH L6321 Case 29 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2891 TABLESWITCH L6321 Case 30 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2892 TABLESWITCH L6321 Case 31 - false * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2893 TABLESWITCH L6321 Case 32 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2894 TABLESWITCH L6321 Case 33 - false * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2895 TABLESWITCH L6321 Case 34 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2896 TABLESWITCH L6321 Case 35 - false * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2897 TABLESWITCH L6321 Case 36 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2898 TABLESWITCH L6321 Case 37 - false * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2899 TABLESWITCH L6321 Case 38 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2900 TABLESWITCH L6321 Case 39 - false * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2901 TABLESWITCH L6321 Case 40 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2902 TABLESWITCH L6321 Case 41 - false * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2903 TABLESWITCH L6321 Case 42 - false * Goal 30. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2904 TABLESWITCH L6321 Case 43 - false * Goal 31. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2905 TABLESWITCH L6321 Case 44 - false * Goal 32. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2906 TABLESWITCH L6321 Case 45 - false * Goal 33. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2907 TABLESWITCH L6321 Case 46 - false * Goal 34. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2908 TABLESWITCH L6321 Case 47 - false * Goal 35. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2909 TABLESWITCH L6321 Case 48 - false * Goal 36. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2910 TABLESWITCH L6321 Case 49 - false * Goal 37. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2911 TABLESWITCH L6321 Case 50 - false * Goal 38. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2912 TABLESWITCH L6321 Case 51 - false * Goal 39. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2913 TABLESWITCH L6321 Case 52 - false * Goal 40. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2914 TABLESWITCH L6321 Case 53 - false * Goal 41. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2915 TABLESWITCH L6321 Case 54 - false * Goal 42. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2916 TABLESWITCH L6321 Case 55 - false * Goal 43. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2917 TABLESWITCH L6321 Case 56 - false * Goal 44. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2918 TABLESWITCH L6321 Case 57 - false * Goal 45. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2919 TABLESWITCH L6321 Case 58 - false * Goal 46. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2920 TABLESWITCH L6321 Case 59 - false * Goal 47. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2921 TABLESWITCH L6321 Case 60 - false * Goal 48. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2922 TABLESWITCH L6321 Case 61 - false * Goal 49. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2923 TABLESWITCH L6321 Case 62 - false * Goal 50. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2924 TABLESWITCH L6321 Case 63 - false * Goal 51. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2925 TABLESWITCH L6321 Case 64 - false * Goal 52. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2926 TABLESWITCH L6321 Case 65 - false * Goal 53. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2927 TABLESWITCH L6321 Case 66 - false * Goal 54. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2928 TABLESWITCH L6321 Case 67 - false * Goal 55. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2929 TABLESWITCH L6321 Case 68 - false * Goal 56. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2930 TABLESWITCH L6321 Case 69 - false * Goal 57. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2931 TABLESWITCH L6321 Case 70 - false * Goal 58. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2932 TABLESWITCH L6321 Case 71 - false * Goal 59. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2933 TABLESWITCH L6321 Case 72 - false * Goal 60. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2934 TABLESWITCH L6321 Case 73 - false * Goal 61. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2935 TABLESWITCH L6321 Case 74 - false * Goal 62. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2936 TABLESWITCH L6321 Case 75 - false * Goal 63. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2937 TABLESWITCH L6321 Case 76 - false * Goal 64. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2938 TABLESWITCH L6321 Case 77 - false * Goal 65. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2939 TABLESWITCH L6321 Case 78 - false * Goal 66. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2940 TABLESWITCH L6321 Case 79 - false * Goal 67. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2941 TABLESWITCH L6321 Case 80 - false * Goal 68. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2942 TABLESWITCH L6321 Case 81 - false * Goal 69. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2943 TABLESWITCH L6321 Case 82 - false * Goal 70. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2944 TABLESWITCH L6321 Case 83 - false * Goal 71. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2945 TABLESWITCH L6321 Case 84 - false * Goal 72. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2946 TABLESWITCH L6321 Case 85 - false * Goal 73. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2947 TABLESWITCH L6321 Case 86 - false * Goal 74. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2948 TABLESWITCH L6321 Case 87 - false * Goal 75. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2949 TABLESWITCH L6321 Case 88 - false * Goal 76. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2950 TABLESWITCH L6321 Case 89 - false * Goal 77. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2951 TABLESWITCH L6321 Case 90 - false * Goal 78. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2952 TABLESWITCH L6321 Case 91 - false * Goal 79. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2953 TABLESWITCH L6321 Case 92 - false * Goal 80. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2954 TABLESWITCH L6321 Case 93 - false * Goal 81. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2955 TABLESWITCH L6321 Case 94 - false * Goal 82. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2956 TABLESWITCH L6321 Case 95 - false * Goal 83. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2957 TABLESWITCH L6321 Case 96 - false * Goal 84. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2958 TABLESWITCH L6321 Case 97 - false * Goal 85. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2959 TABLESWITCH L6321 Case 98 - false * Goal 86. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2960 TABLESWITCH L6321 Case 99 - false * Goal 87. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2961 TABLESWITCH L6321 Case 100 - false * Goal 88. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2962 TABLESWITCH L6321 Case 101 - false * Goal 89. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2963 TABLESWITCH L6321 Case 102 - false * Goal 90. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I37 Branch 2964 TABLESWITCH L6321 Default-Case - true * Goal 91. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I107 Branch 2966 IFEQ L6362 - false * Goal 92. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I135 Branch 2967 IFEQ L6368 - true * Goal 93. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I148 Branch 2968 IFEQ L6375 - false * Goal 94. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValue()V: I167 Branch 2969 IFEQ L6388 - true */ @Test public void test02() throws Throwable { JavaParser javaParser0 = new JavaParser("g-}^<(OG.fa6$I(A<u"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.MemberValue(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 3 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.disable_tracing()V: root-Branch */ @Test public void test03() throws Throwable { PipedOutputStream pipedOutputStream0 = new PipedOutputStream(); assertNotNull(pipedOutputStream0); PipedInputStream pipedInputStream0 = new PipedInputStream(pipedOutputStream0, 2468); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) pipedInputStream0); assertEquals(0, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); javaParser0.disable_tracing(); assertEquals(0, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); } //Test case number: 4 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.IfStatement()V: I107 Branch 2219 IFEQ L5257 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.IfStatement()V: I135 Branch 2220 IFEQ L5263 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.IfStatement()V: I148 Branch 2221 IFEQ L5270 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.IfStatement()V: I167 Branch 2222 IFEQ L5283 - true */ @Test public void test04() throws Throwable { PipedReader pipedReader0 = new PipedReader(); assertNotNull(pipedReader0); JavaParser javaParser0 = new JavaParser((Reader) pipedReader0); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.IfStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 5 /* * 6 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I173 Branch 1126 IFEQ L3060 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I113 Branch 1134 IFEQ L3108 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I197 Branch 1151 IFEQ L3178 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I172 Branch 1162 IFEQ L3240 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I173 Branch 1175 IFEQ L3302 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I185 Branch 1190 IFEQ L3368 - false */ @Test public void test05() throws Throwable { JavaParser javaParser0 = new JavaParser((Reader) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.EqualityExpression(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 6 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.getNextToken()Lcom/soops/CEN4010/JMCA/JParser/Token;: I8 Branch 3946 IFNULL L10991 - true */ @Test public void test06() throws Throwable { char[] charArray0 = new char[6]; CharArrayReader charArrayReader0 = new CharArrayReader(charArray0); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(charArrayReader0); JavaParser javaParser0 = new JavaParser((Reader) charArrayReader0); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(javaParser0); // Undeclared exception! try { Token token0 = javaParser0.getNextToken(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\" (0), after : \"\" // } } //Test case number: 7 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1258 TABLESWITCH L3400 Case 79 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I56 Branch 3938 IF_ICMPGT L10947 - true */ @Test public void test07() throws Throwable { SystemInUtil.addInputLine("{HrU)efL[G9c"); JavaParser javaParser0 = new JavaParser("{HrU)efL[G9c"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.MultiplicativeExpression(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 1. Encountered: { // } } //Test case number: 8 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.SynchronizedStatement()V: I71 Branch 2811 IFEQ L5890 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.SynchronizedStatement()V: I99 Branch 2812 IFEQ L5896 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.SynchronizedStatement()V: I112 Branch 2813 IFEQ L5903 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.SynchronizedStatement()V: I131 Branch 2814 IFEQ L5916 - true */ @Test public void test08() throws Throwable { JavaParser javaParser0 = new JavaParser("?S,$bUl4O]"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.SynchronizedStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 9 /* * 97 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I26 Branch 1835 IFEQ L4802 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I49 Branch 1836 IF_ICMPNE L4806 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1837 TABLESWITCH L4806 Case 14 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1838 TABLESWITCH L4806 Case 15 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1839 TABLESWITCH L4806 Case 16 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1840 TABLESWITCH L4806 Case 17 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1841 TABLESWITCH L4806 Case 18 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1842 TABLESWITCH L4806 Case 19 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1843 TABLESWITCH L4806 Case 20 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1844 TABLESWITCH L4806 Case 21 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1845 TABLESWITCH L4806 Case 22 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1846 TABLESWITCH L4806 Case 23 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1847 TABLESWITCH L4806 Case 24 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1848 TABLESWITCH L4806 Case 25 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1849 TABLESWITCH L4806 Case 26 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1850 TABLESWITCH L4806 Case 27 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1851 TABLESWITCH L4806 Case 28 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1852 TABLESWITCH L4806 Case 29 - false * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1853 TABLESWITCH L4806 Case 30 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1854 TABLESWITCH L4806 Case 31 - false * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1855 TABLESWITCH L4806 Case 32 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1856 TABLESWITCH L4806 Case 33 - false * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1857 TABLESWITCH L4806 Case 34 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1858 TABLESWITCH L4806 Case 35 - false * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1859 TABLESWITCH L4806 Case 36 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1860 TABLESWITCH L4806 Case 37 - false * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1861 TABLESWITCH L4806 Case 38 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1862 TABLESWITCH L4806 Case 39 - false * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1863 TABLESWITCH L4806 Case 40 - false * Goal 30. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1864 TABLESWITCH L4806 Case 41 - false * Goal 31. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1865 TABLESWITCH L4806 Case 42 - false * Goal 32. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1866 TABLESWITCH L4806 Case 43 - false * Goal 33. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1867 TABLESWITCH L4806 Case 44 - false * Goal 34. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1868 TABLESWITCH L4806 Case 45 - false * Goal 35. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1869 TABLESWITCH L4806 Case 46 - false * Goal 36. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1870 TABLESWITCH L4806 Case 47 - false * Goal 37. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1871 TABLESWITCH L4806 Case 48 - false * Goal 38. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1872 TABLESWITCH L4806 Case 49 - false * Goal 39. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1873 TABLESWITCH L4806 Case 50 - false * Goal 40. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1874 TABLESWITCH L4806 Case 51 - false * Goal 41. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1875 TABLESWITCH L4806 Case 52 - false * Goal 42. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1876 TABLESWITCH L4806 Case 53 - false * Goal 43. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1877 TABLESWITCH L4806 Case 54 - false * Goal 44. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1878 TABLESWITCH L4806 Case 55 - false * Goal 45. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1879 TABLESWITCH L4806 Case 56 - false * Goal 46. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1880 TABLESWITCH L4806 Case 57 - false * Goal 47. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1881 TABLESWITCH L4806 Case 58 - false * Goal 48. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1882 TABLESWITCH L4806 Case 59 - false * Goal 49. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1883 TABLESWITCH L4806 Case 60 - false * Goal 50. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1884 TABLESWITCH L4806 Case 61 - false * Goal 51. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1885 TABLESWITCH L4806 Case 62 - false * Goal 52. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1886 TABLESWITCH L4806 Case 63 - false * Goal 53. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1887 TABLESWITCH L4806 Case 64 - false * Goal 54. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1888 TABLESWITCH L4806 Case 65 - false * Goal 55. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1889 TABLESWITCH L4806 Case 66 - false * Goal 56. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1890 TABLESWITCH L4806 Case 67 - false * Goal 57. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1891 TABLESWITCH L4806 Case 68 - false * Goal 58. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1892 TABLESWITCH L4806 Case 69 - false * Goal 59. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1893 TABLESWITCH L4806 Case 70 - false * Goal 60. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1894 TABLESWITCH L4806 Case 71 - false * Goal 61. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1895 TABLESWITCH L4806 Case 72 - false * Goal 62. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1896 TABLESWITCH L4806 Case 73 - false * Goal 63. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1897 TABLESWITCH L4806 Case 74 - false * Goal 64. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1898 TABLESWITCH L4806 Case 75 - false * Goal 65. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1899 TABLESWITCH L4806 Case 76 - false * Goal 66. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1900 TABLESWITCH L4806 Case 77 - false * Goal 67. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1901 TABLESWITCH L4806 Case 78 - false * Goal 68. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1902 TABLESWITCH L4806 Case 79 - false * Goal 69. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1903 TABLESWITCH L4806 Case 80 - false * Goal 70. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1904 TABLESWITCH L4806 Case 81 - false * Goal 71. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1905 TABLESWITCH L4806 Case 82 - false * Goal 72. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1906 TABLESWITCH L4806 Case 83 - false * Goal 73. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1907 TABLESWITCH L4806 Case 84 - false * Goal 74. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1908 TABLESWITCH L4806 Case 85 - false * Goal 75. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1909 TABLESWITCH L4806 Case 86 - false * Goal 76. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1910 TABLESWITCH L4806 Case 87 - false * Goal 77. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1911 TABLESWITCH L4806 Case 88 - false * Goal 78. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1912 TABLESWITCH L4806 Case 89 - false * Goal 79. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1913 TABLESWITCH L4806 Case 90 - false * Goal 80. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1914 TABLESWITCH L4806 Case 91 - false * Goal 81. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1915 TABLESWITCH L4806 Case 92 - false * Goal 82. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1916 TABLESWITCH L4806 Case 93 - false * Goal 83. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1917 TABLESWITCH L4806 Case 94 - false * Goal 84. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1918 TABLESWITCH L4806 Case 95 - false * Goal 85. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1919 TABLESWITCH L4806 Case 96 - false * Goal 86. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1920 TABLESWITCH L4806 Case 97 - false * Goal 87. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1921 TABLESWITCH L4806 Case 98 - false * Goal 88. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1922 TABLESWITCH L4806 Case 99 - false * Goal 89. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1923 TABLESWITCH L4806 Case 100 - false * Goal 90. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I60 Branch 1924 TABLESWITCH L4806 Default-Case - true * Goal 91. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I121 Branch 1926 IFEQ L4856 - false * Goal 92. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I149 Branch 1927 IFEQ L4862 - true * Goal 93. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I162 Branch 1928 IFEQ L4869 - false * Goal 94. com.soops.CEN4010.JMCA.JParser.JavaParser.BlockStatement()V: I181 Branch 1929 IFEQ L4882 - true * Goal 95. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_34(I)Z: I21 Branch 3203 IFNE L7064 - true * Goal 96. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_34()Z: I13 Branch 3597 IFEQ L9129 - false * Goal 97. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_34()Z: I26 Branch 3598 IFEQ L9132 - false */ @Test public void test09() throws Throwable { JavaParser javaParser0 = new JavaParser("NhR1ZS"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.BlockStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 10 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I166 Branch 1418 IFEQ L3792 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I107 Branch 1433 IFEQ L3897 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I255 Branch 1460 IFEQ L4020 - true */ @Test public void test10() throws Throwable { byte[] byteArray0 = new byte[2]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); assertEquals(2, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) byteArrayInputStream0); assertEquals(2, byteArrayInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new byte[] {(byte)0, (byte)0}, byteArray0); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.PostfixExpression(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\" (0), after : \"\" // } } //Test case number: 11 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I145 Branch 2212 IFEQ L5211 - false */ @Test public void test11() throws Throwable { JavaParser javaParser0 = new JavaParser((JavaParserTokenManager) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.SwitchLabel(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 12 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Arguments()V: I128 Branch 1590 IFEQ L4261 - true */ @Test public void test12() throws Throwable { EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile("/Users/fabiopalomba/Documents/workspace/LunchEvosuite/OR"); byte[] byteArray0 = new byte[1]; boolean boolean0 = FileSystemHandling.appendDataToFile(evoSuiteFile0, byteArray0); assertArrayEquals(new byte[] {(byte)0}, byteArray0); assertTrue(boolean0); JavaParser javaParser0 = new JavaParser("OR"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.Arguments(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 2. Encountered: <EOF> after : \"\" // } } //Test case number: 13 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Arguments()V: I87 Branch 1588 IFEQ L4248 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Arguments()V: I115 Branch 1589 IFEQ L4254 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Arguments()V: I128 Branch 1590 IFEQ L4261 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Arguments()V: I147 Branch 1591 IFEQ L4274 - true */ @Test public void test13() throws Throwable { JavaParser javaParser0 = new JavaParser("*,"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.Arguments(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 14 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ReInit(Ljava/io/Reader;)V: root-Branch */ @Test public void test14() throws Throwable { JavaParser javaParser0 = new JavaParser("Y:mIJY4'glX[hY-`Cn%"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); char[] charArray0 = new char[6]; CharArrayReader charArrayReader0 = new CharArrayReader(charArray0); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(charArrayReader0); BufferedReader bufferedReader0 = new BufferedReader((Reader) charArrayReader0); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(bufferedReader0); LineNumberReader lineNumberReader0 = new LineNumberReader((Reader) bufferedReader0, (int) '\\'); assertEquals(0, lineNumberReader0.getLineNumber()); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(lineNumberReader0); javaParser0.ReInit((Reader) lineNumberReader0); assertEquals(0, lineNumberReader0.getLineNumber()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); } //Test case number: 15 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.LabeledStatement()V: I61 Branch 1737 IFEQ L4674 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.LabeledStatement()V: I89 Branch 1738 IFEQ L4680 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.LabeledStatement()V: I102 Branch 1739 IFEQ L4687 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.LabeledStatement()V: I121 Branch 1740 IFEQ L4700 - true */ @Test public void test15() throws Throwable { JavaParser javaParser0 = new JavaParser(""); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.LabeledStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 16 /* * 11 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I26 Branch 1619 IFEQ L4420 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I89 Branch 1622 IF_ICMPNE L4441 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I100 Branch 1623 LOOKUPSWITCH L4441 Case 81 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I100 Branch 1624 LOOKUPSWITCH L4441 Default-Case - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I194 Branch 1629 IFEQ L4463 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I222 Branch 1630 IFEQ L4469 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I235 Branch 1631 IFEQ L4476 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.ArrayDimsAndInits()V: I254 Branch 1632 IFEQ L4489 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_32(I)Z: I21 Branch 3201 IFNE L7044 - true * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_30()Z: I8 Branch 3659 IFEQ L9453 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_32()Z: I7 Branch 3665 IFEQ L9484 - false */ @Test public void test16() throws Throwable { PipedInputStream pipedInputStream0 = new PipedInputStream(727); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) pipedInputStream0); assertEquals(0, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ArrayDimsAndInits(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 17 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberSelector()V: I61 Branch 1436 IFEQ L3926 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberSelector()V: I89 Branch 1437 IFEQ L3932 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberSelector()V: I102 Branch 1438 IFEQ L3939 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberSelector()V: I121 Branch 1439 IFEQ L3952 - true */ @Test public void test17() throws Throwable { JavaParser javaParser0 = new JavaParser("-"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.MemberSelector(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 18 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameters()V: I107 Branch 246 IFEQ L961 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameters()V: I135 Branch 247 IFEQ L967 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameters()V: I148 Branch 248 IFEQ L974 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameters()V: I167 Branch 249 IFEQ L987 - true */ @Test public void test18() throws Throwable { JavaParser javaParser0 = new JavaParser(""); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TypeParameters(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 19 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.EnumBody()V: I215 Branch 229 IFEQ L867 - false */ @Test public void test19() throws Throwable { JavaParser javaParser0 = new JavaParser("Y:mIJY4'glX[hY-`Cn%"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.EnumBody(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 20 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I202 Branch 30 IFEQ L227 - true */ @Test public void test20() throws Throwable { byte[] byteArray0 = new byte[4]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); SequenceInputStream sequenceInputStream0 = new SequenceInputStream((InputStream) byteArrayInputStream0, (InputStream) byteArrayInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(sequenceInputStream0); BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) sequenceInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(bufferedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) bufferedInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.CompilationUnit(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\" (0), after : \"\" // } } //Test case number: 21 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.EnumBody()V: I174 Branch 227 IFEQ L854 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.EnumBody()V: I202 Branch 228 IFEQ L860 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.EnumBody()V: I215 Branch 229 IFEQ L867 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.EnumBody()V: I234 Branch 230 IFEQ L880 - true */ @Test public void test21() throws Throwable { StringBufferInputStream stringBufferInputStream0 = new StringBufferInputStream("L"); assertEquals(2, stringBufferInputStream0.available()); assertNotNull(stringBufferInputStream0); BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) stringBufferInputStream0); assertEquals(2, stringBufferInputStream0.available()); assertNotNull(bufferedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) bufferedInputStream0); assertEquals(2, stringBufferInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.EnumBody(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\\u007f\" (127), after : \"\" // } } //Test case number: 22 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.FieldDeclaration(I)V: I133 Branch 459 IFEQ L1323 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.FieldDeclaration(I)V: I146 Branch 460 IFEQ L1330 - false */ @Test public void test22() throws Throwable { PipedInputStream pipedInputStream0 = new PipedInputStream(21); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) pipedInputStream0); assertEquals(0, pipedInputStream0.available()); assertNotNull(bufferedInputStream0); JavaCharStream javaCharStream0 = new JavaCharStream((InputStream) bufferedInputStream0, 21, 0, 21); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertNotNull(javaCharStream0); JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0, 0); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertNotNull(javaParserTokenManager0); JavaParser javaParser0 = new JavaParser(javaParserTokenManager0); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.FieldDeclaration(0); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 21, column -1. Encountered: <EOF> // } } //Test case number: 23 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Modifiers()I: I312 Branch 64 IFEQ L424 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Modifiers()I: I340 Branch 65 IFEQ L430 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Modifiers()I: I372 Branch 67 IFEQ L450 - true */ @Test public void test23() throws Throwable { JavaParser javaParser0 = new JavaParser((Reader) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { int int0 = javaParser0.Modifiers(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 24 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchStatement()V: I155 Branch 2202 IFEQ L5152 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchStatement()V: I183 Branch 2203 IFEQ L5158 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchStatement()V: I196 Branch 2204 IFEQ L5165 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchStatement()V: I215 Branch 2205 IFEQ L5178 - true */ @Test public void test24() throws Throwable { JavaParser javaParser0 = new JavaParser("re-transmit"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.SwitchStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 25 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.PreDecrementExpression()V: I55 Branch 1298 IFEQ L3534 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.PreDecrementExpression()V: I83 Branch 1299 IFEQ L3540 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.PreDecrementExpression()V: I96 Branch 1300 IFEQ L3547 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.PreDecrementExpression()V: I115 Branch 1301 IFEQ L3560 - true */ @Test public void test25() throws Throwable { JavaParser javaParser0 = new JavaParser("g"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.PreDecrementExpression(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 26 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TryStatement()V: I153 Branch 2822 IFEQ L5953 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TryStatement()V: I181 Branch 2823 IFEQ L5959 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TryStatement()V: I194 Branch 2824 IFEQ L5966 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TryStatement()V: I213 Branch 2825 IFEQ L5979 - true */ @Test public void test26() throws Throwable { JavaParser javaParser0 = new JavaParser(""); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TryStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 27 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isStatic(I)Z: I8 Branch 3955 IFEQ L65 - false */ @Test public void test27() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isStatic((-3370)); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertTrue(boolean0); } //Test case number: 28 /* * 7 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I186 Branch 1127 IFEQ L3067 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I126 Branch 1135 IFEQ L3115 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I210 Branch 1152 IFEQ L3185 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I185 Branch 1163 IFEQ L3247 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I186 Branch 1176 IFEQ L3309 - true * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I198 Branch 1191 IFEQ L3375 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I214 Branch 1290 IFEQ L3465 - true */ @Test public void test28() throws Throwable { char[] charArray0 = new char[5]; CharArrayReader charArrayReader0 = new CharArrayReader(charArray0); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(charArrayReader0); JavaParser javaParser0 = new JavaParser((Reader) charArrayReader0); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.EqualityExpression(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\" (0), after : \"\" // } } //Test case number: 29 /* * 13 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I26 Branch 1475 IF_ICMPNE L4111 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1476 LOOKUPSWITCH L4111 Case 30 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1477 LOOKUPSWITCH L4111 Case 45 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1478 LOOKUPSWITCH L4111 Case 61 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1479 LOOKUPSWITCH L4111 Case 66 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1480 LOOKUPSWITCH L4111 Case 70 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1481 LOOKUPSWITCH L4111 Case 72 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1482 LOOKUPSWITCH L4111 Case 73 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I37 Branch 1483 LOOKUPSWITCH L4111 Default-Case - true * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I145 Branch 1485 IFEQ L4136 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I173 Branch 1486 IFEQ L4142 - true * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I186 Branch 1487 IFEQ L4149 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.Literal()V: I205 Branch 1488 IFEQ L4162 - true */ @Test public void test29() throws Throwable { JavaParser javaParser0 = new JavaParser("re-transmit"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.Literal(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 30 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isFinal(I)Z: I8 Branch 3957 IFEQ L73 - true */ @Test public void test30() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isFinal((-2154)); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertFalse(boolean0); } //Test case number: 31 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBody(Z)V: I98 Branch 345 IFEQ L1139 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBody(Z)V: I126 Branch 346 IFEQ L1145 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBody(Z)V: I158 Branch 348 IFEQ L1165 - true */ @Test public void test31() throws Throwable { JavaParser javaParser0 = new JavaParser((Reader) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.ClassOrInterfaceBody(false); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 32 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isFinal(I)Z: I8 Branch 3957 IFEQ L73 - false */ @Test public void test32() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(32, javaParser_ModifierSet0.FINAL); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isFinal((-3551)); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(32, javaParser_ModifierSet0.FINAL); assertTrue(boolean0); } //Test case number: 33 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceType()V: I102 Branch 942 IFEQ L2239 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceType()V: I130 Branch 943 IFEQ L2245 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceType()V: I143 Branch 944 IFEQ L2252 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceType()V: I162 Branch 945 IFEQ L2265 - true */ @Test public void test33() throws Throwable { JavaParser javaParser0 = new JavaParser("re-^ransmi"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ClassOrInterfaceType(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 34 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I140 Branch 27 IFEQ L240 - false */ @Test public void test34() throws Throwable { byte[] byteArray0 = new byte[4]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0, (int) (byte)15, (int) (byte)0); assertEquals(-11, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); JavaCharStream javaCharStream0 = new JavaCharStream((InputStream) byteArrayInputStream0, (int) (byte)0, (int) (byte)0, (int) (byte)15); assertEquals(-11, byteArrayInputStream0.available()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertFalse(javaCharStream0.staticFlag); assertEquals((-1), javaCharStream0.bufpos); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(javaCharStream0); JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0); assertEquals(-11, byteArrayInputStream0.available()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertFalse(javaCharStream0.staticFlag); assertEquals((-1), javaCharStream0.bufpos); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(javaParserTokenManager0); JavaParser javaParser0 = new JavaParser(javaParserTokenManager0); assertEquals(-11, byteArrayInputStream0.available()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertFalse(javaParser0.lookingAhead); assertFalse(javaCharStream0.staticFlag); assertEquals((-1), javaCharStream0.bufpos); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); assertNotNull(javaParser0); javaParser0.CompilationUnit(); assertEquals(-11, byteArrayInputStream0.available()); assertEquals(-1, javaCharStream0.getBeginColumn()); assertEquals(-1, javaCharStream0.getColumn()); assertEquals(0, javaCharStream0.getLine()); assertEquals(-1, javaCharStream0.getEndColumn()); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, javaCharStream0.getEndLine()); assertFalse(javaParser0.lookingAhead); assertFalse(javaCharStream0.staticFlag); assertEquals(0, javaCharStream0.bufpos); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); } //Test case number: 35 /* * 11 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I26 Branch 896 IF_ICMPNE L2033 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I37 Branch 897 LOOKUPSWITCH L2033 Case 52 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I37 Branch 898 LOOKUPSWITCH L2033 Default-Case - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I81 Branch 900 IFEQ L2042 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I109 Branch 901 IFEQ L2048 - true * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I122 Branch 902 IFEQ L2055 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.Initializer()V: I141 Branch 903 IFEQ L2068 - true * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.Block()V: I97 Branch 1831 IFEQ L4764 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.Block()V: I125 Branch 1832 IFEQ L4770 - true * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.Block()V: I138 Branch 1833 IFEQ L4777 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.Block()V: I157 Branch 1834 IFEQ L4790 - true */ @Test public void test35() throws Throwable { JavaParser javaParser0 = new JavaParser(" java JavaParser inputfile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.Initializer(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 36 /* * 21 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I125 Branch 1416 IFEQ L3779 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I153 Branch 1417 IFEQ L3785 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I166 Branch 1418 IFEQ L3792 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I185 Branch 1419 IFEQ L3805 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I66 Branch 1431 IFEQ L3884 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I94 Branch 1432 IFEQ L3890 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I107 Branch 1433 IFEQ L3897 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I126 Branch 1434 IFEQ L3910 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I26 Branch 1440 IF_ICMPNE L3964 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I164 Branch 1455 LOOKUPSWITCH L3996 Case 74 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I164 Branch 1456 LOOKUPSWITCH L3996 Default-Case - true * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I214 Branch 1458 IFEQ L4007 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I242 Branch 1459 IFEQ L4013 - true * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I255 Branch 1460 IFEQ L4020 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I274 Branch 1461 IFEQ L4033 - true * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_85()Z: I7 Branch 3219 IFEQ L7185 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_60()Z: I12 Branch 3221 IFEQ L7201 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_60()Z: I25 Branch 3222 IFEQ L7203 - false * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_25()Z: I7 Branch 3712 IFEQ L9739 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_104()Z: I7 Branch 3895 IFEQ L10669 - false * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_76()Z: I26 Branch 3897 IFEQ L10680 - false */ @Test public void test36() throws Throwable { JavaParser javaParser0 = new JavaParser(" rava JavaParser inputZile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.PostfixExpression(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 37 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclarator()V: I126 Branch 468 IFEQ L1378 - false */ @Test public void test37() throws Throwable { BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) null, 3123); assertNotNull(bufferedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) bufferedInputStream0); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.VariableDeclarator(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 38 /* * 16 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I26 Branch 954 IF_ICMPNE L2330 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 955 LOOKUPSWITCH L2330 Case 15 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 956 LOOKUPSWITCH L2330 Case 17 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 957 LOOKUPSWITCH L2330 Case 20 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 958 LOOKUPSWITCH L2330 Case 26 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 959 LOOKUPSWITCH L2330 Case 33 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 960 LOOKUPSWITCH L2330 Case 40 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 961 LOOKUPSWITCH L2330 Case 42 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 962 LOOKUPSWITCH L2330 Case 51 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 963 LOOKUPSWITCH L2330 Case 74 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 964 LOOKUPSWITCH L2330 Case 91 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I37 Branch 965 LOOKUPSWITCH L2330 Default-Case - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I129 Branch 971 IFEQ L2358 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I157 Branch 972 IFEQ L2364 - true * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I170 Branch 973 IFEQ L2371 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArgument()V: I189 Branch 974 IFEQ L2384 - true */ @Test public void test38() throws Throwable { JavaParser javaParser0 = new JavaParser("ear"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TypeArgument(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 39 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isStrictfp(I)Z: I8 Branch 3959 IFEQ L81 - true */ @Test public void test39() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isStrictfp(0); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertFalse(boolean0); } //Test case number: 40 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I189 Branch 29 IFEQ L220 - false */ @Test public void test40() throws Throwable { JavaParser javaParser0 = new JavaParser((JavaParserTokenManager) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.CompilationUnit(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 41 /* * 18 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I26 Branch 904 IFEQ L2083 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I43 Branch 905 IF_ICMPNE L2086 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 906 LOOKUPSWITCH L2086 Case 15 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 907 LOOKUPSWITCH L2086 Case 17 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 908 LOOKUPSWITCH L2086 Case 20 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 909 LOOKUPSWITCH L2086 Case 26 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 910 LOOKUPSWITCH L2086 Case 33 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 911 LOOKUPSWITCH L2086 Case 40 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 912 LOOKUPSWITCH L2086 Case 42 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 913 LOOKUPSWITCH L2086 Case 51 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I54 Branch 914 LOOKUPSWITCH L2086 Default-Case - true * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I132 Branch 917 IFEQ L2109 - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I145 Branch 918 IFEQ L2116 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_9(I)Z: I21 Branch 3178 IFNE L6814 - true * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_94()Z: I7 Branch 3210 IFEQ L7131 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_67()Z: I25 Branch 3216 IFEQ L7167 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_9()Z: I7 Branch 3220 IFEQ L7192 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_123()Z: I8 Branch 3933 IFEQ L10868 - false */ @Test public void test41() throws Throwable { JavaParser javaParser0 = new JavaParser(" java JavaParser inputfile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.Type(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 42 /* * 8 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePairs()V: I95 Branch 2866 IFEQ L6241 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePairs()V: I123 Branch 2867 IFEQ L6247 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePairs()V: I136 Branch 2868 IFEQ L6254 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePairs()V: I155 Branch 2869 IFEQ L6267 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePair()V: I61 Branch 2871 IFEQ L6283 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePair()V: I89 Branch 2872 IFEQ L6289 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePair()V: I102 Branch 2873 IFEQ L6296 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.MemberValuePair()V: I121 Branch 2874 IFEQ L6309 - true */ @Test public void test42() throws Throwable { JavaParser javaParser0 = new JavaParser("SemanticHeadFinder failed to reassign head for"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.MemberValuePairs(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 43 /* * 6 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.FieldDeclaration(I)V: I105 Branch 458 IFEQ L1317 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.FieldDeclaration(I)V: I133 Branch 459 IFEQ L1323 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.FieldDeclaration(I)V: I165 Branch 461 IFEQ L1343 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I104 Branch 916 IFEQ L2103 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I132 Branch 917 IFEQ L2109 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.Type()V: I164 Branch 919 IFEQ L2129 - true */ @Test public void test43() throws Throwable { JavaParser javaParser0 = new JavaParser((JavaParserTokenManager) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.FieldDeclaration(1133); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 44 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1371 TABLESWITCH L3593 Case 74 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1375 TABLESWITCH L3593 Default-Case - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I218 Branch 1378 IFEQ L3630 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I231 Branch 1379 IFEQ L3637 - false */ @Test public void test44() throws Throwable { byte[] byteArray0 = new byte[1]; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0, (int) (byte) (-88), (int) (byte) (-88)); assertEquals(-88, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); SequenceInputStream sequenceInputStream0 = new SequenceInputStream((InputStream) byteArrayInputStream0, (InputStream) byteArrayInputStream0); assertEquals(-88, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0}, byteArray0); assertNotNull(sequenceInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) sequenceInputStream0); assertEquals(-88, byteArrayInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new byte[] {(byte)0}, byteArray0); assertNotNull(javaParser0); try { javaParser0.UnaryExpressionNotPlusMinus(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 45 /* * 5 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I37 Branch 976 LOOKUPSWITCH L2396 Case 29 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I37 Branch 977 LOOKUPSWITCH L2396 Case 54 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I37 Branch 978 LOOKUPSWITCH L2396 Default-Case - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I137 Branch 981 IFEQ L2416 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I150 Branch 982 IFEQ L2423 - false */ @Test public void test45() throws Throwable { JavaParser javaParser0 = new JavaParser("Y:mIJY4'glX[hY-`Cn%"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.WildcardBounds(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 46 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.WhileStatement()V: I99 Branch 2225 IFEQ L5307 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.WhileStatement()V: I112 Branch 2226 IFEQ L5314 - false */ @Test public void test46() throws Throwable { JavaParser javaParser0 = new JavaParser((String) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.WhileStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 47 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ReInit(Lcom/soops/CEN4010/JMCA/JParser/JavaParserTokenManager;)V: root-Branch */ @Test public void test47() throws Throwable { PipedInputStream pipedInputStream0 = new PipedInputStream(1924); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); JavaCharStream javaCharStream0 = new JavaCharStream((InputStream) pipedInputStream0, 1924, 1924); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertNotNull(javaCharStream0); JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertNotNull(javaParserTokenManager0); JavaParser javaParser0 = new JavaParser(javaParserTokenManager0); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); javaParser0.ReInit(javaParserTokenManager0); assertEquals(0, javaCharStream0.getBeginLine()); assertEquals(0, javaCharStream0.getBeginColumn()); assertEquals(0, pipedInputStream0.available()); assertEquals((-1), javaCharStream0.bufpos); assertFalse(javaCharStream0.staticFlag); assertFalse(javaParser0.lookingAhead); } //Test case number: 48 /* * 10 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I26 Branch 1600 IFEQ L4337 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I53 Branch 1601 IF_ICMPNE L4342 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I64 Branch 1602 LOOKUPSWITCH L4342 Case 44 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I64 Branch 1603 LOOKUPSWITCH L4342 Default-Case - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I227 Branch 1615 IFEQ L4378 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I255 Branch 1616 IFEQ L4384 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I268 Branch 1617 IFEQ L4391 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.AllocationExpression()V: I287 Branch 1618 IFEQ L4404 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_29(I)Z: I21 Branch 3198 IFNE L7014 - true * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_29()Z: I8 Branch 3680 IFEQ L9566 - false */ @Test public void test48() throws Throwable { JavaParser javaParser0 = new JavaParser("Y:mIJY4'glX[hY-`Cn%"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.AllocationExpression(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 49 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isStrictfp(I)Z: I8 Branch 3959 IFEQ L81 - false */ @Test public void test49() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isStrictfp((-2551)); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertTrue(boolean0); } //Test case number: 50 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.RSIGNEDSHIFT()V: I93 Branch 2833 IFEQ L6027 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I7 Branch 3947 IFEQ L11001 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I37 Branch 3949 IFNULL L11003 - true */ @Test public void test50() throws Throwable { JavaParser javaParser0 = new JavaParser((JavaParserTokenManager) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.RSIGNEDSHIFT(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 51 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isPrivate(I)Z: I8 Branch 3954 IFEQ L61 - false */ @Test public void test51() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isPrivate((-3068)); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertTrue(boolean0); } //Test case number: 52 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isVolatile(I)Z: I8 Branch 3962 IFEQ L93 - false */ @Test public void test52() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isVolatile(1924); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertTrue(boolean0); } //Test case number: 53 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ForStatement()V: I240 Branch 2589 IFEQ L5522 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ForStatement()V: I268 Branch 2590 IFEQ L5528 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ForStatement()V: I281 Branch 2591 IFEQ L5535 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ForStatement()V: I300 Branch 2592 IFEQ L5548 - true */ @Test public void test53() throws Throwable { PipedInputStream pipedInputStream0 = new PipedInputStream(); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) pipedInputStream0); assertEquals(0, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ForStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 54 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I26 Branch 975 IF_ICMPNE L2396 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I109 Branch 980 IFEQ L2410 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I137 Branch 981 IFEQ L2416 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.WildcardBounds()V: I169 Branch 983 IFEQ L2436 - true */ @Test public void test54() throws Throwable { JavaParser javaParser0 = new JavaParser((JavaParserTokenManager) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.WildcardBounds(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 55 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameter()V: I81 Branch 254 IFEQ L1008 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameter()V: I109 Branch 255 IFEQ L1014 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameter()V: I122 Branch 256 IFEQ L1021 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeParameter()V: I141 Branch 257 IFEQ L1034 - true */ @Test public void test55() throws Throwable { JavaParser javaParser0 = new JavaParser(" java JavaParser inputfile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TypeParameter(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 56 /* * 20 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I66 Branch 1026 IFEQ L2633 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I94 Branch 1027 IFEQ L2639 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I107 Branch 1028 IFEQ L2646 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I126 Branch 1029 IFEQ L2659 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I95 Branch 1072 IFEQ L2737 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I123 Branch 1073 IFEQ L2743 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I136 Branch 1074 IFEQ L2750 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I155 Branch 1075 IFEQ L2763 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I95 Branch 1080 IFEQ L2788 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I123 Branch 1081 IFEQ L2794 - true * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I136 Branch 1082 IFEQ L2801 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I155 Branch 1083 IFEQ L2814 - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I95 Branch 1088 IFEQ L2839 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I123 Branch 1089 IFEQ L2845 - true * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I136 Branch 1090 IFEQ L2852 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I155 Branch 1091 IFEQ L2865 - true * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I95 Branch 1596 IFEQ L4299 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I123 Branch 1597 IFEQ L4305 - true * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I136 Branch 1598 IFEQ L4312 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I155 Branch 1599 IFEQ L4325 - true */ @Test public void test56() throws Throwable { StringBufferInputStream stringBufferInputStream0 = new StringBufferInputStream(""); assertEquals(0, stringBufferInputStream0.available()); assertNotNull(stringBufferInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) stringBufferInputStream0); assertEquals(0, stringBufferInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ArgumentList(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 57 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isSynchronized(I)Z: I8 Branch 3960 IFEQ L85 - false */ @Test public void test57() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isSynchronized((-4646)); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertTrue(boolean0); } //Test case number: 58 /* * 22 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I26 Branch 68 IF_ICMPNE L467 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 69 LOOKUPSWITCH L467 Case 13 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 70 LOOKUPSWITCH L467 Case 21 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 71 LOOKUPSWITCH L467 Case 28 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 72 LOOKUPSWITCH L467 Case 31 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 73 LOOKUPSWITCH L467 Case 41 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 74 LOOKUPSWITCH L467 Case 43 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 75 LOOKUPSWITCH L467 Case 47 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 76 LOOKUPSWITCH L467 Case 48 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 77 LOOKUPSWITCH L467 Case 49 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 78 LOOKUPSWITCH L467 Case 52 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 79 LOOKUPSWITCH L467 Case 53 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 80 LOOKUPSWITCH L467 Case 56 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 81 LOOKUPSWITCH L467 Case 60 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 82 LOOKUPSWITCH L467 Case 64 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 83 LOOKUPSWITCH L467 Case 83 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 84 LOOKUPSWITCH L467 Case 86 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I37 Branch 85 LOOKUPSWITCH L467 Default-Case - true * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I159 Branch 93 IFEQ L508 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I187 Branch 94 IFEQ L514 - true * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I200 Branch 95 IFEQ L521 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeDeclaration()V: I219 Branch 96 IFEQ L534 - true */ @Test public void test58() throws Throwable { JavaParser javaParser0 = new JavaParser(" rava JavaParser inputZile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TypeDeclaration(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 59 /* * 88 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I30 Branch 349 IFEQ L1181 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I68 Branch 351 IF_ICMPNE L1192 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 352 TABLESWITCH L1192 Case 13 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 353 TABLESWITCH L1192 Case 14 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 354 TABLESWITCH L1192 Case 15 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 355 TABLESWITCH L1192 Case 16 - false * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 356 TABLESWITCH L1192 Case 17 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 357 TABLESWITCH L1192 Case 18 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 358 TABLESWITCH L1192 Case 19 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 359 TABLESWITCH L1192 Case 20 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 360 TABLESWITCH L1192 Case 21 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 361 TABLESWITCH L1192 Case 22 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 362 TABLESWITCH L1192 Case 23 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 363 TABLESWITCH L1192 Case 24 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 364 TABLESWITCH L1192 Case 25 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 365 TABLESWITCH L1192 Case 26 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 366 TABLESWITCH L1192 Case 27 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 367 TABLESWITCH L1192 Case 28 - false * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 368 TABLESWITCH L1192 Case 29 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 369 TABLESWITCH L1192 Case 30 - false * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 370 TABLESWITCH L1192 Case 31 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 371 TABLESWITCH L1192 Case 32 - false * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 372 TABLESWITCH L1192 Case 33 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 373 TABLESWITCH L1192 Case 34 - false * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 374 TABLESWITCH L1192 Case 35 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 375 TABLESWITCH L1192 Case 36 - false * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 376 TABLESWITCH L1192 Case 37 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 377 TABLESWITCH L1192 Case 38 - false * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 378 TABLESWITCH L1192 Case 39 - false * Goal 30. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 379 TABLESWITCH L1192 Case 40 - false * Goal 31. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 380 TABLESWITCH L1192 Case 41 - false * Goal 32. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 381 TABLESWITCH L1192 Case 42 - false * Goal 33. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 382 TABLESWITCH L1192 Case 43 - false * Goal 34. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 383 TABLESWITCH L1192 Case 44 - false * Goal 35. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 384 TABLESWITCH L1192 Case 45 - false * Goal 36. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 385 TABLESWITCH L1192 Case 46 - false * Goal 37. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 386 TABLESWITCH L1192 Case 47 - false * Goal 38. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 387 TABLESWITCH L1192 Case 48 - false * Goal 39. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 388 TABLESWITCH L1192 Case 49 - false * Goal 40. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 389 TABLESWITCH L1192 Case 50 - false * Goal 41. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 390 TABLESWITCH L1192 Case 51 - false * Goal 42. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 391 TABLESWITCH L1192 Case 52 - false * Goal 43. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 392 TABLESWITCH L1192 Case 53 - false * Goal 44. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 393 TABLESWITCH L1192 Case 54 - false * Goal 45. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 394 TABLESWITCH L1192 Case 55 - false * Goal 46. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 395 TABLESWITCH L1192 Case 56 - false * Goal 47. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 396 TABLESWITCH L1192 Case 57 - false * Goal 48. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 397 TABLESWITCH L1192 Case 58 - false * Goal 49. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 398 TABLESWITCH L1192 Case 59 - false * Goal 50. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 399 TABLESWITCH L1192 Case 60 - false * Goal 51. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 400 TABLESWITCH L1192 Case 61 - false * Goal 52. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 401 TABLESWITCH L1192 Case 62 - false * Goal 53. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 402 TABLESWITCH L1192 Case 63 - false * Goal 54. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 403 TABLESWITCH L1192 Case 64 - false * Goal 55. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 404 TABLESWITCH L1192 Case 65 - false * Goal 56. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 405 TABLESWITCH L1192 Case 66 - false * Goal 57. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 406 TABLESWITCH L1192 Case 67 - false * Goal 58. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 407 TABLESWITCH L1192 Case 68 - false * Goal 59. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 408 TABLESWITCH L1192 Case 69 - false * Goal 60. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 409 TABLESWITCH L1192 Case 70 - false * Goal 61. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 410 TABLESWITCH L1192 Case 71 - false * Goal 62. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 411 TABLESWITCH L1192 Case 72 - false * Goal 63. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 412 TABLESWITCH L1192 Case 73 - false * Goal 64. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 413 TABLESWITCH L1192 Case 74 - false * Goal 65. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 414 TABLESWITCH L1192 Case 75 - false * Goal 66. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 415 TABLESWITCH L1192 Case 76 - false * Goal 67. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 416 TABLESWITCH L1192 Case 77 - false * Goal 68. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 417 TABLESWITCH L1192 Case 78 - false * Goal 69. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 418 TABLESWITCH L1192 Case 79 - false * Goal 70. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 419 TABLESWITCH L1192 Case 80 - false * Goal 71. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 420 TABLESWITCH L1192 Case 81 - false * Goal 72. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 421 TABLESWITCH L1192 Case 82 - false * Goal 73. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 422 TABLESWITCH L1192 Case 83 - false * Goal 74. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 423 TABLESWITCH L1192 Case 84 - false * Goal 75. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 424 TABLESWITCH L1192 Case 85 - false * Goal 76. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 425 TABLESWITCH L1192 Case 86 - false * Goal 77. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 426 TABLESWITCH L1192 Case 87 - false * Goal 78. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 427 TABLESWITCH L1192 Case 88 - false * Goal 79. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I79 Branch 428 TABLESWITCH L1192 Default-Case - true * Goal 80. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I256 Branch 450 IFEQ L1264 - false * Goal 81. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I284 Branch 451 IFEQ L1270 - true * Goal 82. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I297 Branch 452 IFEQ L1277 - false * Goal 83. com.soops.CEN4010.JMCA.JParser.JavaParser.ClassOrInterfaceBodyDeclaration(Z)V: I316 Branch 453 IFEQ L1290 - true * Goal 84. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_4(I)Z: I21 Branch 3173 IFNE L6764 - true * Goal 85. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_62()Z: I13 Branch 3226 IFEQ L7226 - false * Goal 86. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_62()Z: I26 Branch 3227 IFEQ L7229 - false * Goal 87. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_4()Z: I7 Branch 3359 IFEQ L7924 - false * Goal 88. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_86()Z: I8 Branch 3610 IFEQ L9198 - false */ @Test public void test59() throws Throwable { PipedReader pipedReader0 = new PipedReader(); assertNotNull(pipedReader0); JavaParser javaParser0 = new JavaParser((Reader) pipedReader0); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ClassOrInterfaceBodyDeclaration(false); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 60 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isAbstract(I)Z: I8 Branch 3956 IFEQ L69 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I201 Branch 1289 IFEQ L3458 - false */ @Test public void test60() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isAbstract((-31)); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertFalse(boolean0); JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager((JavaCharStream) null); assertNotNull(javaParserTokenManager0); JavaParser javaParser0 = new JavaParser(javaParserTokenManager0); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.UnaryExpression(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 61 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I26 Branch 1302 IF_ICMPNE L3573 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I190 Branch 1377 IFEQ L3624 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I218 Branch 1378 IFEQ L3630 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I250 Branch 1380 IFEQ L3650 - true */ @Test public void test61() throws Throwable { byte[] byteArray0 = new byte[4]; byteArray0[2] = (byte)43; ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0, (int) (byte) (-2), (int) (byte)43); assertEquals(6, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)43, (byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) byteArrayInputStream0); assertEquals(6, byteArrayInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)43, (byte)0}, byteArray0); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.UnaryExpressionNotPlusMinus(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 62 /* * 13 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ReInit(Ljava/io/InputStream;)V: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I26 Branch 1381 IFEQ L3665 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I49 Branch 1382 IFEQ L3668 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I84 Branch 1383 IF_ICMPNE L3674 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I95 Branch 1384 LOOKUPSWITCH L3674 Case 77 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I95 Branch 1385 LOOKUPSWITCH L3674 Default-Case - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I277 Branch 1403 IFEQ L3721 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I305 Branch 1404 IFEQ L3727 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I318 Branch 1405 IFEQ L3734 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.CastLookahead()V: I337 Branch 1406 IFEQ L3747 - true * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_21(I)Z: I21 Branch 3190 IFNE L6934 - true * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_22(I)Z: I21 Branch 3191 IFNE L6944 - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_22()Z: I8 Branch 3762 IFEQ L9974 - false */ @Test public void test62() throws Throwable { JavaParser javaParser0 = new JavaParser("l!\u0004U,r$Fz2%L@^!8"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); PipedOutputStream pipedOutputStream0 = new PipedOutputStream(); assertNotNull(pipedOutputStream0); PipedInputStream pipedInputStream0 = new PipedInputStream(pipedOutputStream0); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); javaParser0.ReInit((InputStream) pipedInputStream0); assertEquals(0, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); JavaParser javaParser1 = new JavaParser("l!\u0004U,r$Fz2%L@^!8"); assertFalse(javaParser1.lookingAhead); assertFalse(javaParser1.equals((Object)javaParser0)); assertNotNull(javaParser1); assertNotSame(javaParser1, javaParser0); try { javaParser1.CastLookahead(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 63 /* * 29 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I26 Branch 3 IF_ICMPNE L170 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I37 Branch 4 LOOKUPSWITCH L170 Case 46 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I37 Branch 5 LOOKUPSWITCH L170 Default-Case - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I56 Branch 6 IF_ICMPNE L178 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I67 Branch 7 LOOKUPSWITCH L178 Case 38 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I67 Branch 8 LOOKUPSWITCH L178 Default-Case - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I96 Branch 9 IF_ICMPNE L188 - true * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 10 LOOKUPSWITCH L188 Case 13 - false * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 11 LOOKUPSWITCH L188 Case 21 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 12 LOOKUPSWITCH L188 Case 28 - false * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 13 LOOKUPSWITCH L188 Case 31 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 14 LOOKUPSWITCH L188 Case 41 - false * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 15 LOOKUPSWITCH L188 Case 43 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 16 LOOKUPSWITCH L188 Case 47 - false * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 17 LOOKUPSWITCH L188 Case 48 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 18 LOOKUPSWITCH L188 Case 49 - false * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 19 LOOKUPSWITCH L188 Case 52 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 20 LOOKUPSWITCH L188 Case 53 - false * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 21 LOOKUPSWITCH L188 Case 56 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 22 LOOKUPSWITCH L188 Case 60 - false * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 23 LOOKUPSWITCH L188 Case 64 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 24 LOOKUPSWITCH L188 Case 83 - false * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 25 LOOKUPSWITCH L188 Case 86 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I107 Branch 26 LOOKUPSWITCH L188 Default-Case - true * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I161 Branch 28 IFEQ L214 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I189 Branch 29 IFEQ L220 - true * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I202 Branch 30 IFEQ L227 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.CompilationUnit()V: I221 Branch 31 IFEQ L240 - true * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.generateParseException()Lcom/soops/CEN4010/JMCA/JParser/ParseException;: I22 Branch 3951 IFNE L11023 - true */ @Test public void test63() throws Throwable { byte[] byteArray0 = new byte[4]; byteArray0[0] = (byte) (-31); byteArray0[2] = (byte) (-74); byteArray0[1] = (byte) (-74); ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte) (-31), (byte) (-74), (byte) (-74), (byte)0}, byteArray0); assertNotNull(byteArrayInputStream0); SequenceInputStream sequenceInputStream0 = new SequenceInputStream((InputStream) byteArrayInputStream0, (InputStream) byteArrayInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte) (-31), (byte) (-74), (byte) (-74), (byte)0}, byteArray0); assertNotNull(sequenceInputStream0); BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) sequenceInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertArrayEquals(new byte[] {(byte) (-31), (byte) (-74), (byte) (-74), (byte)0}, byteArray0); assertNotNull(bufferedInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) bufferedInputStream0); assertEquals(4, byteArrayInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new byte[] {(byte) (-31), (byte) (-74), (byte) (-74), (byte)0}, byteArray0); assertNotNull(javaParser0); try { javaParser0.CompilationUnit(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 1. Encountered: \u1DB6 // } } //Test case number: 64 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.BreakStatement()V: I88 Branch 2704 IFEQ L5734 - false */ @Test public void test64() throws Throwable { JavaParser javaParser0 = new JavaParser(" java JavaParser inputfile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.BreakStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 65 /* * 5 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.removeModifier(II)I: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.DoStatement()V: I83 Branch 2229 IFEQ L5347 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.DoStatement()V: I111 Branch 2230 IFEQ L5353 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.DoStatement()V: I124 Branch 2231 IFEQ L5360 - false * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.DoStatement()V: I143 Branch 2232 IFEQ L5373 - true */ @Test public void test65() throws Throwable { int int0 = JavaParser.ModifierSet.removeModifier(1718, 1718); assertEquals(0, int0); JavaParser javaParser0 = new JavaParser("yt<"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.DoStatement(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 66 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I37 Branch 724 LOOKUPSWITCH L1839 Case 88 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I37 Branch 725 LOOKUPSWITCH L1839 Default-Case - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I227 Branch 822 IFEQ L1926 - false */ @Test public void test66() throws Throwable { StringBufferInputStream stringBufferInputStream0 = new StringBufferInputStream(""); assertEquals(0, stringBufferInputStream0.available()); assertNotNull(stringBufferInputStream0); Charset charset0 = Charset.defaultCharset(); assertEquals("UTF-8", charset0.displayName()); assertEquals("UTF-8", charset0.name()); assertTrue(charset0.isRegistered()); assertEquals("UTF-8", charset0.toString()); assertTrue(charset0.canEncode()); assertNotNull(charset0); InputStreamReader inputStreamReader0 = new InputStreamReader((InputStream) stringBufferInputStream0, charset0); assertEquals(0, stringBufferInputStream0.available()); assertEquals("UTF-8", charset0.displayName()); assertEquals("UTF-8", charset0.name()); assertTrue(charset0.isRegistered()); assertEquals("UTF-8", charset0.toString()); assertTrue(charset0.canEncode()); assertNotNull(inputStreamReader0); JavaParser javaParser0 = new JavaParser((Reader) inputStreamReader0); assertEquals(0, stringBufferInputStream0.available()); assertEquals("UTF-8", charset0.displayName()); assertEquals("UTF-8", charset0.name()); assertTrue(charset0.isRegistered()); assertEquals("UTF-8", charset0.toString()); assertTrue(charset0.canEncode()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.ConstructorDeclaration(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 67 /* * 42 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I95 Branch 1096 IFEQ L2890 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I123 Branch 1097 IFEQ L2896 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I136 Branch 1098 IFEQ L2903 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I155 Branch 1099 IFEQ L2916 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I95 Branch 1104 IFEQ L2941 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I123 Branch 1105 IFEQ L2947 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I136 Branch 1106 IFEQ L2954 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I155 Branch 1107 IFEQ L2967 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I95 Branch 1112 IFEQ L2992 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I123 Branch 1113 IFEQ L2998 - true * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I136 Branch 1114 IFEQ L3005 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I155 Branch 1115 IFEQ L3018 - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I145 Branch 1125 IFEQ L3054 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I173 Branch 1126 IFEQ L3060 - true * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I186 Branch 1127 IFEQ L3067 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I205 Branch 1128 IFEQ L3080 - true * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I85 Branch 1133 IFEQ L3102 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I113 Branch 1134 IFEQ L3108 - true * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I126 Branch 1135 IFEQ L3115 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I145 Branch 1136 IFEQ L3128 - true * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I169 Branch 1150 IFEQ L3172 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I197 Branch 1151 IFEQ L3178 - true * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I210 Branch 1152 IFEQ L3185 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I229 Branch 1153 IFEQ L3198 - true * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I144 Branch 1161 IFEQ L3234 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I172 Branch 1162 IFEQ L3240 - true * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I185 Branch 1163 IFEQ L3247 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I204 Branch 1164 IFEQ L3260 - true * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I145 Branch 1174 IFEQ L3296 - false * Goal 30. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I173 Branch 1175 IFEQ L3302 - true * Goal 31. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I186 Branch 1176 IFEQ L3309 - false * Goal 32. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I205 Branch 1177 IFEQ L3322 - true * Goal 33. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I157 Branch 1189 IFEQ L3362 - false * Goal 34. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I185 Branch 1190 IFEQ L3368 - true * Goal 35. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I198 Branch 1191 IFEQ L3375 - false * Goal 36. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I217 Branch 1192 IFEQ L3388 - true * Goal 37. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1253 TABLESWITCH L3400 Case 74 - false * Goal 38. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1282 TABLESWITCH L3400 Default-Case - true * Goal 39. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I173 Branch 1288 IFEQ L3452 - false * Goal 40. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I201 Branch 1289 IFEQ L3458 - true * Goal 41. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I214 Branch 1290 IFEQ L3465 - false * Goal 42. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I233 Branch 1291 IFEQ L3478 - true */ @Test public void test67() throws Throwable { JavaParser javaParser0 = new JavaParser(""); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.InclusiveOrExpression(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 68 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isNative(I)Z: I8 Branch 3958 IFEQ L77 - false */ @Test public void test68() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isNative(1757); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertTrue(boolean0); } //Test case number: 69 /* * 5 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclarator()V: I85 Branch 466 IFEQ L1365 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclarator()V: I113 Branch 467 IFEQ L1371 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclarator()V: I126 Branch 468 IFEQ L1378 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclarator()V: I145 Branch 469 IFEQ L1391 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclaratorId()V: I32 Branch 470 IF_ICMPNE L1405 - false */ @Test public void test69() throws Throwable { PipedOutputStream pipedOutputStream0 = new PipedOutputStream(); assertNotNull(pipedOutputStream0); PipedInputStream pipedInputStream0 = new PipedInputStream(pipedOutputStream0); assertEquals(0, pipedInputStream0.available()); assertNotNull(pipedInputStream0); BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) pipedInputStream0, 3123); assertEquals(0, pipedInputStream0.available()); assertNotNull(bufferedInputStream0); byte[] byteArray0 = new byte[9]; byteArray0[0] = (byte)101; pipedOutputStream0.write(byteArray0); assertArrayEquals(new byte[] {(byte)101, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0}, byteArray0); JavaParser javaParser0 = new JavaParser((InputStream) bufferedInputStream0); assertEquals(9, pipedInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.VariableDeclarator(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 2. Encountered: \"\" (0), after : \"\" // } } //Test case number: 70 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isPublic(I)Z: I8 Branch 3952 IFEQ L53 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isSynchronized(I)Z: I8 Branch 3960 IFEQ L85 - true */ @Test public void test70() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isPublic((-3329)); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertTrue(boolean0); boolean boolean1 = javaParser_ModifierSet0.isSynchronized(0); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertFalse(boolean1 == boolean0); assertFalse(boolean1); } //Test case number: 71 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isStatic(I)Z: I8 Branch 3955 IFEQ L65 - true * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isNative(I)Z: I8 Branch 3958 IFEQ L77 - true */ @Test public void test71() throws Throwable { char[] charArray0 = new char[3]; JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isNative((int) '\u0000'); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertFalse(boolean0); boolean boolean1 = javaParser_ModifierSet0.isStatic((int) '\u0000'); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertTrue(boolean1 == boolean0); assertFalse(boolean1); } //Test case number: 72 /* * 5 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I26 Branch 723 IF_ICMPNE L1839 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I186 Branch 820 IFEQ L1913 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I214 Branch 821 IFEQ L1919 - true * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I227 Branch 822 IFEQ L1926 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.ConstructorDeclaration()V: I246 Branch 823 IFEQ L1939 - true */ @Test public void test72() throws Throwable { char[] charArray0 = new char[4]; CharArrayReader charArrayReader0 = new CharArrayReader(charArray0); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(charArrayReader0); JavaParser javaParser0 = new JavaParser((Reader) charArrayReader0); assertFalse(javaParser0.lookingAhead); assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000'}, charArray0); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.ConstructorDeclaration(); fail("Expecting exception: Error"); } catch(Error e) { // // Lexical error at line 1, column 1. Encountered: \"\" (0), after : \"\" // } } //Test case number: 73 /* * 3 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.WhileStatement()V: I71 Branch 2224 IFEQ L5301 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.WhileStatement()V: I99 Branch 2225 IFEQ L5307 - false * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.WhileStatement()V: I131 Branch 2227 IFEQ L5327 - true */ @Test public void test73() throws Throwable { JavaParser javaParser0 = new JavaParser((Reader) null); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.WhileStatement(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 74 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.<init>(Ljava/io/Reader;)V: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.VariableDeclaratorId()V: I98 Branch 474 IFEQ L1416 - false */ @Test public void test74() throws Throwable { FileDescriptor fileDescriptor0 = new FileDescriptor(); assertFalse(fileDescriptor0.valid()); assertNotNull(fileDescriptor0); MockFileReader mockFileReader0 = new MockFileReader(fileDescriptor0); assertFalse(fileDescriptor0.valid()); assertNotNull(mockFileReader0); JavaParser javaParser0 = new JavaParser((Reader) mockFileReader0); assertFalse(fileDescriptor0.valid()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); // Undeclared exception! try { javaParser0.VariableDeclaratorId(); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // } } //Test case number: 75 /* * 353 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.<init>(Lcom/soops/CEN4010/JMCA/JParser/JavaParserTokenManager;)V: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.Name()V: I32 Branch 1013 IFEQ L2550 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.Name()V: I55 Branch 1014 IFEQ L2559 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I30 Branch 1024 IFEQ L2626 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.Expression()V: I45 Branch 1025 IFEQ L2659 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I30 Branch 1068 IF_ICMPNE L2726 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I41 Branch 1069 LOOKUPSWITCH L2726 Case 91 - false * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I41 Branch 1070 LOOKUPSWITCH L2726 Default-Case - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalExpression()V: I74 Branch 1071 IFEQ L2763 - false * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I30 Branch 1076 IF_ICMPNE L2777 - true * Goal 11. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I41 Branch 1077 LOOKUPSWITCH L2777 Case 97 - false * Goal 12. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I41 Branch 1078 LOOKUPSWITCH L2777 Default-Case - true * Goal 13. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalOrExpression()V: I74 Branch 1079 IFEQ L2814 - false * Goal 14. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I30 Branch 1084 IF_ICMPNE L2828 - true * Goal 15. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I41 Branch 1085 LOOKUPSWITCH L2828 Case 98 - false * Goal 16. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I41 Branch 1086 LOOKUPSWITCH L2828 Default-Case - true * Goal 17. com.soops.CEN4010.JMCA.JParser.JavaParser.ConditionalAndExpression()V: I74 Branch 1087 IFEQ L2865 - false * Goal 18. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I30 Branch 1092 IF_ICMPNE L2879 - true * Goal 19. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I41 Branch 1093 LOOKUPSWITCH L2879 Case 106 - false * Goal 20. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I41 Branch 1094 LOOKUPSWITCH L2879 Default-Case - true * Goal 21. com.soops.CEN4010.JMCA.JParser.JavaParser.InclusiveOrExpression()V: I74 Branch 1095 IFEQ L2916 - false * Goal 22. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I30 Branch 1100 IF_ICMPNE L2930 - true * Goal 23. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I41 Branch 1101 LOOKUPSWITCH L2930 Case 107 - false * Goal 24. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I41 Branch 1102 LOOKUPSWITCH L2930 Default-Case - true * Goal 25. com.soops.CEN4010.JMCA.JParser.JavaParser.ExclusiveOrExpression()V: I74 Branch 1103 IFEQ L2967 - false * Goal 26. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I30 Branch 1108 IF_ICMPNE L2981 - true * Goal 27. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I41 Branch 1109 LOOKUPSWITCH L2981 Case 105 - false * Goal 28. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I41 Branch 1110 LOOKUPSWITCH L2981 Default-Case - true * Goal 29. com.soops.CEN4010.JMCA.JParser.JavaParser.AndExpression()V: I74 Branch 1111 IFEQ L3018 - false * Goal 30. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I30 Branch 1116 IF_ICMPNE L3032 - true * Goal 31. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I41 Branch 1117 LOOKUPSWITCH L3032 Case 93 - false * Goal 32. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I41 Branch 1118 LOOKUPSWITCH L3032 Case 96 - false * Goal 33. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I41 Branch 1119 LOOKUPSWITCH L3032 Default-Case - true * Goal 34. com.soops.CEN4010.JMCA.JParser.JavaParser.EqualityExpression()V: I124 Branch 1124 IFEQ L3080 - false * Goal 35. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I30 Branch 1129 IF_ICMPNE L3093 - true * Goal 36. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I41 Branch 1130 LOOKUPSWITCH L3093 Case 39 - false * Goal 37. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I41 Branch 1131 LOOKUPSWITCH L3093 Default-Case - true * Goal 38. com.soops.CEN4010.JMCA.JParser.JavaParser.InstanceOfExpression()V: I64 Branch 1132 IFEQ L3128 - false * Goal 39. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I30 Branch 1137 IF_ICMPNE L3142 - true * Goal 40. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I41 Branch 1138 LOOKUPSWITCH L3142 Case 88 - false * Goal 41. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I41 Branch 1139 LOOKUPSWITCH L3142 Case 94 - false * Goal 42. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I41 Branch 1140 LOOKUPSWITCH L3142 Case 95 - false * Goal 43. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I41 Branch 1141 LOOKUPSWITCH L3142 Case 124 - false * Goal 44. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I41 Branch 1142 LOOKUPSWITCH L3142 Default-Case - true * Goal 45. com.soops.CEN4010.JMCA.JParser.JavaParser.RelationalExpression()V: I148 Branch 1149 IFEQ L3198 - false * Goal 46. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I30 Branch 1154 IFEQ L3212 - true * Goal 47. com.soops.CEN4010.JMCA.JParser.JavaParser.ShiftExpression()V: I123 Branch 1160 IFEQ L3260 - false * Goal 48. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I30 Branch 1165 IF_ICMPNE L3274 - true * Goal 49. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I41 Branch 1166 LOOKUPSWITCH L3274 Case 101 - false * Goal 50. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I41 Branch 1167 LOOKUPSWITCH L3274 Case 102 - false * Goal 51. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I41 Branch 1168 LOOKUPSWITCH L3274 Default-Case - true * Goal 52. com.soops.CEN4010.JMCA.JParser.JavaParser.AdditiveExpression()V: I124 Branch 1173 IFEQ L3322 - false * Goal 53. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I30 Branch 1178 IF_ICMPNE L3336 - true * Goal 54. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I41 Branch 1179 LOOKUPSWITCH L3336 Case 103 - false * Goal 55. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I41 Branch 1180 LOOKUPSWITCH L3336 Case 104 - false * Goal 56. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I41 Branch 1181 LOOKUPSWITCH L3336 Case 108 - false * Goal 57. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I41 Branch 1182 LOOKUPSWITCH L3336 Default-Case - true * Goal 58. com.soops.CEN4010.JMCA.JParser.JavaParser.MultiplicativeExpression()V: I136 Branch 1188 IFEQ L3388 - false * Goal 59. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I26 Branch 1193 IF_ICMPNE L3400 - false * Goal 60. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1194 TABLESWITCH L3400 Case 15 - false * Goal 61. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1195 TABLESWITCH L3400 Case 16 - false * Goal 62. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1196 TABLESWITCH L3400 Case 17 - false * Goal 63. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1197 TABLESWITCH L3400 Case 18 - false * Goal 64. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1198 TABLESWITCH L3400 Case 19 - false * Goal 65. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1199 TABLESWITCH L3400 Case 20 - false * Goal 66. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1200 TABLESWITCH L3400 Case 21 - false * Goal 67. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1201 TABLESWITCH L3400 Case 22 - false * Goal 68. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1202 TABLESWITCH L3400 Case 23 - false * Goal 69. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1203 TABLESWITCH L3400 Case 24 - false * Goal 70. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1204 TABLESWITCH L3400 Case 25 - false * Goal 71. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1205 TABLESWITCH L3400 Case 26 - false * Goal 72. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1206 TABLESWITCH L3400 Case 27 - false * Goal 73. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1207 TABLESWITCH L3400 Case 28 - false * Goal 74. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1208 TABLESWITCH L3400 Case 29 - false * Goal 75. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1209 TABLESWITCH L3400 Case 30 - false * Goal 76. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1210 TABLESWITCH L3400 Case 31 - false * Goal 77. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1211 TABLESWITCH L3400 Case 32 - false * Goal 78. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1212 TABLESWITCH L3400 Case 33 - false * Goal 79. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1213 TABLESWITCH L3400 Case 34 - false * Goal 80. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1214 TABLESWITCH L3400 Case 35 - false * Goal 81. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1215 TABLESWITCH L3400 Case 36 - false * Goal 82. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1216 TABLESWITCH L3400 Case 37 - false * Goal 83. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1217 TABLESWITCH L3400 Case 38 - false * Goal 84. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1218 TABLESWITCH L3400 Case 39 - false * Goal 85. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1219 TABLESWITCH L3400 Case 40 - false * Goal 86. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1220 TABLESWITCH L3400 Case 41 - false * Goal 87. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1221 TABLESWITCH L3400 Case 42 - false * Goal 88. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1222 TABLESWITCH L3400 Case 43 - false * Goal 89. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1223 TABLESWITCH L3400 Case 44 - false * Goal 90. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1224 TABLESWITCH L3400 Case 45 - false * Goal 91. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1225 TABLESWITCH L3400 Case 46 - false * Goal 92. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1226 TABLESWITCH L3400 Case 47 - false * Goal 93. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1227 TABLESWITCH L3400 Case 48 - false * Goal 94. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1228 TABLESWITCH L3400 Case 49 - false * Goal 95. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1229 TABLESWITCH L3400 Case 50 - false * Goal 96. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1230 TABLESWITCH L3400 Case 51 - false * Goal 97. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1231 TABLESWITCH L3400 Case 52 - false * Goal 98. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1232 TABLESWITCH L3400 Case 53 - false * Goal 99. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1233 TABLESWITCH L3400 Case 54 - false * Goal 100. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1234 TABLESWITCH L3400 Case 55 - false * Goal 101. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1235 TABLESWITCH L3400 Case 56 - false * Goal 102. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1236 TABLESWITCH L3400 Case 57 - false * Goal 103. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1237 TABLESWITCH L3400 Case 58 - false * Goal 104. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1238 TABLESWITCH L3400 Case 59 - false * Goal 105. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1239 TABLESWITCH L3400 Case 60 - false * Goal 106. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1240 TABLESWITCH L3400 Case 61 - false * Goal 107. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1241 TABLESWITCH L3400 Case 62 - false * Goal 108. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1242 TABLESWITCH L3400 Case 63 - false * Goal 109. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1243 TABLESWITCH L3400 Case 64 - false * Goal 110. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1244 TABLESWITCH L3400 Case 65 - false * Goal 111. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1245 TABLESWITCH L3400 Case 66 - false * Goal 112. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1246 TABLESWITCH L3400 Case 67 - false * Goal 113. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1247 TABLESWITCH L3400 Case 68 - false * Goal 114. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1248 TABLESWITCH L3400 Case 69 - false * Goal 115. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1249 TABLESWITCH L3400 Case 70 - false * Goal 116. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1250 TABLESWITCH L3400 Case 71 - false * Goal 117. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1251 TABLESWITCH L3400 Case 72 - false * Goal 118. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1252 TABLESWITCH L3400 Case 73 - false * Goal 119. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1253 TABLESWITCH L3400 Case 74 - true * Goal 120. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1254 TABLESWITCH L3400 Case 75 - false * Goal 121. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1255 TABLESWITCH L3400 Case 76 - false * Goal 122. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1256 TABLESWITCH L3400 Case 77 - false * Goal 123. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1257 TABLESWITCH L3400 Case 78 - false * Goal 124. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1258 TABLESWITCH L3400 Case 79 - false * Goal 125. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1259 TABLESWITCH L3400 Case 80 - false * Goal 126. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1260 TABLESWITCH L3400 Case 81 - false * Goal 127. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1261 TABLESWITCH L3400 Case 82 - false * Goal 128. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1262 TABLESWITCH L3400 Case 83 - false * Goal 129. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1263 TABLESWITCH L3400 Case 84 - false * Goal 130. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1264 TABLESWITCH L3400 Case 85 - false * Goal 131. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1265 TABLESWITCH L3400 Case 86 - false * Goal 132. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1266 TABLESWITCH L3400 Case 87 - false * Goal 133. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1267 TABLESWITCH L3400 Case 88 - false * Goal 134. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1268 TABLESWITCH L3400 Case 89 - false * Goal 135. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1269 TABLESWITCH L3400 Case 90 - false * Goal 136. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1270 TABLESWITCH L3400 Case 91 - false * Goal 137. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1271 TABLESWITCH L3400 Case 92 - false * Goal 138. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1272 TABLESWITCH L3400 Case 93 - false * Goal 139. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1273 TABLESWITCH L3400 Case 94 - false * Goal 140. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1274 TABLESWITCH L3400 Case 95 - false * Goal 141. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1275 TABLESWITCH L3400 Case 96 - false * Goal 142. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1276 TABLESWITCH L3400 Case 97 - false * Goal 143. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1277 TABLESWITCH L3400 Case 98 - false * Goal 144. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1278 TABLESWITCH L3400 Case 99 - false * Goal 145. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1279 TABLESWITCH L3400 Case 100 - false * Goal 146. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1280 TABLESWITCH L3400 Case 101 - false * Goal 147. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1281 TABLESWITCH L3400 Case 102 - false * Goal 148. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I37 Branch 1282 TABLESWITCH L3400 Default-Case - false * Goal 149. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpression()V: I152 Branch 1287 IFEQ L3478 - false * Goal 150. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I26 Branch 1302 IF_ICMPNE L3573 - true * Goal 151. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I37 Branch 1303 LOOKUPSWITCH L3573 Case 89 - false * Goal 152. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I37 Branch 1304 LOOKUPSWITCH L3573 Case 90 - false * Goal 153. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I37 Branch 1305 LOOKUPSWITCH L3573 Default-Case - true * Goal 154. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I112 Branch 1310 IFEQ L3590 - true * Goal 155. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I129 Branch 1311 IF_ICMPNE L3593 - true * Goal 156. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1312 TABLESWITCH L3593 Case 15 - false * Goal 157. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1313 TABLESWITCH L3593 Case 16 - false * Goal 158. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1314 TABLESWITCH L3593 Case 17 - false * Goal 159. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1315 TABLESWITCH L3593 Case 18 - false * Goal 160. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1316 TABLESWITCH L3593 Case 19 - false * Goal 161. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1317 TABLESWITCH L3593 Case 20 - false * Goal 162. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1318 TABLESWITCH L3593 Case 21 - false * Goal 163. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1319 TABLESWITCH L3593 Case 22 - false * Goal 164. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1320 TABLESWITCH L3593 Case 23 - false * Goal 165. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1321 TABLESWITCH L3593 Case 24 - false * Goal 166. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1322 TABLESWITCH L3593 Case 25 - false * Goal 167. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1323 TABLESWITCH L3593 Case 26 - false * Goal 168. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1324 TABLESWITCH L3593 Case 27 - false * Goal 169. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1325 TABLESWITCH L3593 Case 28 - false * Goal 170. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1326 TABLESWITCH L3593 Case 29 - false * Goal 171. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1327 TABLESWITCH L3593 Case 30 - false * Goal 172. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1328 TABLESWITCH L3593 Case 31 - false * Goal 173. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1329 TABLESWITCH L3593 Case 32 - false * Goal 174. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1330 TABLESWITCH L3593 Case 33 - false * Goal 175. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1331 TABLESWITCH L3593 Case 34 - false * Goal 176. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1332 TABLESWITCH L3593 Case 35 - false * Goal 177. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1333 TABLESWITCH L3593 Case 36 - false * Goal 178. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1334 TABLESWITCH L3593 Case 37 - false * Goal 179. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1335 TABLESWITCH L3593 Case 38 - false * Goal 180. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1336 TABLESWITCH L3593 Case 39 - false * Goal 181. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1337 TABLESWITCH L3593 Case 40 - false * Goal 182. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1338 TABLESWITCH L3593 Case 41 - false * Goal 183. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1339 TABLESWITCH L3593 Case 42 - false * Goal 184. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1340 TABLESWITCH L3593 Case 43 - false * Goal 185. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1341 TABLESWITCH L3593 Case 44 - false * Goal 186. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1342 TABLESWITCH L3593 Case 45 - false * Goal 187. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1343 TABLESWITCH L3593 Case 46 - false * Goal 188. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1344 TABLESWITCH L3593 Case 47 - false * Goal 189. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1345 TABLESWITCH L3593 Case 48 - false * Goal 190. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1346 TABLESWITCH L3593 Case 49 - false * Goal 191. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1347 TABLESWITCH L3593 Case 50 - false * Goal 192. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1348 TABLESWITCH L3593 Case 51 - false * Goal 193. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1349 TABLESWITCH L3593 Case 52 - false * Goal 194. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1350 TABLESWITCH L3593 Case 53 - false * Goal 195. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1351 TABLESWITCH L3593 Case 54 - false * Goal 196. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1352 TABLESWITCH L3593 Case 55 - false * Goal 197. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1353 TABLESWITCH L3593 Case 56 - false * Goal 198. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1354 TABLESWITCH L3593 Case 57 - false * Goal 199. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1355 TABLESWITCH L3593 Case 58 - false * Goal 200. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1356 TABLESWITCH L3593 Case 59 - false * Goal 201. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1357 TABLESWITCH L3593 Case 60 - false * Goal 202. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1358 TABLESWITCH L3593 Case 61 - false * Goal 203. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1359 TABLESWITCH L3593 Case 62 - false * Goal 204. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1360 TABLESWITCH L3593 Case 63 - false * Goal 205. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1361 TABLESWITCH L3593 Case 64 - false * Goal 206. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1362 TABLESWITCH L3593 Case 65 - false * Goal 207. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1363 TABLESWITCH L3593 Case 66 - false * Goal 208. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1364 TABLESWITCH L3593 Case 67 - false * Goal 209. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1365 TABLESWITCH L3593 Case 68 - false * Goal 210. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1366 TABLESWITCH L3593 Case 69 - false * Goal 211. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1367 TABLESWITCH L3593 Case 70 - false * Goal 212. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1368 TABLESWITCH L3593 Case 71 - false * Goal 213. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1369 TABLESWITCH L3593 Case 72 - false * Goal 214. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1370 TABLESWITCH L3593 Case 73 - false * Goal 215. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1371 TABLESWITCH L3593 Case 74 - true * Goal 216. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1372 TABLESWITCH L3593 Case 75 - false * Goal 217. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1373 TABLESWITCH L3593 Case 76 - false * Goal 218. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1374 TABLESWITCH L3593 Case 77 - false * Goal 219. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I140 Branch 1375 TABLESWITCH L3593 Default-Case - false * Goal 220. com.soops.CEN4010.JMCA.JParser.JavaParser.UnaryExpressionNotPlusMinus()V: I169 Branch 1376 IFEQ L3650 - false * Goal 221. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I30 Branch 1407 IF_ICMPNE L3760 - false * Goal 222. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I41 Branch 1408 LOOKUPSWITCH L3760 Case 99 - false * Goal 223. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I41 Branch 1409 LOOKUPSWITCH L3760 Case 100 - false * Goal 224. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I41 Branch 1410 LOOKUPSWITCH L3760 Default-Case - true * Goal 225. com.soops.CEN4010.JMCA.JParser.JavaParser.PostfixExpression()V: I104 Branch 1415 IFEQ L3805 - false * Goal 226. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I30 Branch 1429 IFEQ L3876 - true * Goal 227. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryExpression()V: I45 Branch 1430 IFEQ L3910 - false * Goal 228. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I26 Branch 1440 IF_ICMPNE L3964 - true * Goal 229. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1441 LOOKUPSWITCH L3964 Case 30 - false * Goal 230. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1442 LOOKUPSWITCH L3964 Case 44 - false * Goal 231. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1443 LOOKUPSWITCH L3964 Case 45 - false * Goal 232. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1444 LOOKUPSWITCH L3964 Case 54 - false * Goal 233. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1445 LOOKUPSWITCH L3964 Case 57 - false * Goal 234. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1446 LOOKUPSWITCH L3964 Case 61 - false * Goal 235. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1447 LOOKUPSWITCH L3964 Case 66 - false * Goal 236. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1448 LOOKUPSWITCH L3964 Case 70 - false * Goal 237. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1449 LOOKUPSWITCH L3964 Case 72 - false * Goal 238. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1450 LOOKUPSWITCH L3964 Case 73 - false * Goal 239. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1451 LOOKUPSWITCH L3964 Case 77 - false * Goal 240. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I37 Branch 1452 LOOKUPSWITCH L3964 Default-Case - true * Goal 241. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I124 Branch 1453 IFEQ L3991 - true * Goal 242. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I153 Branch 1454 IF_ICMPNE L3996 - true * Goal 243. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I164 Branch 1455 LOOKUPSWITCH L3996 Case 74 - true * Goal 244. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I164 Branch 1456 LOOKUPSWITCH L3996 Default-Case - false * Goal 245. com.soops.CEN4010.JMCA.JParser.JavaParser.PrimaryPrefix()V: I193 Branch 1457 IFEQ L4033 - false * Goal 246. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I30 Branch 1592 IF_ICMPNE L4288 - true * Goal 247. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I41 Branch 1593 LOOKUPSWITCH L4288 Case 84 - false * Goal 248. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I41 Branch 1594 LOOKUPSWITCH L4288 Default-Case - true * Goal 249. com.soops.CEN4010.JMCA.JParser.JavaParser.ArgumentList()V: I74 Branch 1595 IFEQ L4325 - false * Goal 250. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I26 Branch 2206 IF_ICMPNE L5190 - false * Goal 251. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I37 Branch 2207 LOOKUPSWITCH L5190 Case 18 - false * Goal 252. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I37 Branch 2208 LOOKUPSWITCH L5190 Case 24 - false * Goal 253. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I37 Branch 2209 LOOKUPSWITCH L5190 Default-Case - true * Goal 254. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I117 Branch 2211 IFEQ L5205 - false * Goal 255. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I145 Branch 2212 IFEQ L5211 - true * Goal 256. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I158 Branch 2213 IFEQ L5218 - false * Goal 257. com.soops.CEN4010.JMCA.JParser.JavaParser.SwitchLabel()V: I177 Branch 2214 IFEQ L5231 - true * Goal 258. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_15(I)Z: I21 Branch 3184 IFNE L6874 - true * Goal 259. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_16(I)Z: I21 Branch 3185 IFNE L6884 - true * Goal 260. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_17(I)Z: I21 Branch 3186 IFNE L6894 - true * Goal 261. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_20(I)Z: I21 Branch 3189 IFNE L6924 - true * Goal 262. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_24(I)Z: I21 Branch 3193 IFNE L6964 - true * Goal 263. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_2_25(I)Z: I21 Branch 3194 IFNE L6974 - true * Goal 264. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_94()Z: I7 Branch 3210 IFEQ L7131 - true * Goal 265. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_94()Z: I24 Branch 3211 IFEQ L7137 - false * Goal 266. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_93()Z: I7 Branch 3212 IFEQ L7146 - false * Goal 267. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_67()Z: I12 Branch 3215 IFEQ L7165 - false * Goal 268. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_67()Z: I25 Branch 3216 IFEQ L7167 - true * Goal 269. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_9()Z: I7 Branch 3220 IFEQ L7192 - true * Goal 270. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_60()Z: I12 Branch 3221 IFEQ L7201 - true * Goal 271. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_71()Z: I21 Branch 3405 IF_ICMPNE L8182 - true * Goal 272. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_71()Z: I53 Branch 3407 IFEQ L8185 - true * Goal 273. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_72()Z: I21 Branch 3421 IF_ICMPNE L8257 - true * Goal 274. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_72()Z: I53 Branch 3423 IFEQ L8260 - true * Goal 275. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_66()Z: I8 Branch 3688 IFEQ L9613 - false * Goal 276. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_103()Z: I7 Branch 3703 IFEQ L9692 - false * Goal 277. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_102()Z: I8 Branch 3704 IFEQ L9699 - false * Goal 278. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_101()Z: I8 Branch 3706 IFEQ L9709 - false * Goal 279. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_28()Z: I7 Branch 3709 IFEQ L9722 - false * Goal 280. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_27()Z: I8 Branch 3710 IFEQ L9729 - false * Goal 281. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_25()Z: I7 Branch 3712 IFEQ L9739 - true * Goal 282. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_25()Z: I20 Branch 3713 IFEQ L9742 - false * Goal 283. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_26()Z: I8 Branch 3715 IFEQ L9752 - false * Goal 284. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I12 Branch 3717 IFEQ L9764 - false * Goal 285. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I25 Branch 3718 IFEQ L9766 - false * Goal 286. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I38 Branch 3719 IFEQ L9768 - false * Goal 287. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I51 Branch 3720 IFEQ L9770 - false * Goal 288. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I64 Branch 3721 IFEQ L9772 - false * Goal 289. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_75()Z: I77 Branch 3722 IFEQ L9774 - false * Goal 290. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_24()Z: I7 Branch 3731 IFEQ L9826 - false * Goal 291. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_78()Z: I8 Branch 3745 IFEQ L9892 - false * Goal 292. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_100()Z: I8 Branch 3767 IFEQ L9999 - false * Goal 293. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_99()Z: I8 Branch 3778 IFEQ L10038 - false * Goal 294. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_21()Z: I8 Branch 3782 IFEQ L10054 - false * Goal 295. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_73()Z: I12 Branch 3784 IFEQ L10066 - false * Goal 296. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_73()Z: I25 Branch 3785 IFEQ L10068 - false * Goal 297. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_73()Z: I38 Branch 3786 IFEQ L10070 - false * Goal 298. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_20()Z: I7 Branch 3787 IFEQ L10079 - false * Goal 299. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_19()Z: I7 Branch 3788 IFEQ L10086 - false * Goal 300. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_18()Z: I7 Branch 3802 IFEQ L10162 - false * Goal 301. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_17()Z: I13 Branch 3810 IFEQ L10206 - false * Goal 302. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_17()Z: I26 Branch 3811 IFEQ L10208 - false * Goal 303. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_17()Z: I39 Branch 3812 IFEQ L10210 - false * Goal 304. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I13 Branch 3871 IFEQ L10557 - false * Goal 305. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I27 Branch 3872 IFEQ L10559 - false * Goal 306. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I41 Branch 3873 IFEQ L10561 - false * Goal 307. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I55 Branch 3874 IFEQ L10563 - false * Goal 308. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I69 Branch 3875 IFEQ L10565 - false * Goal 309. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I83 Branch 3876 IFEQ L10567 - false * Goal 310. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I97 Branch 3877 IFEQ L10569 - false * Goal 311. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I111 Branch 3878 IFEQ L10571 - false * Goal 312. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I125 Branch 3879 IFEQ L10573 - false * Goal 313. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I139 Branch 3880 IFEQ L10575 - false * Goal 314. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I153 Branch 3881 IFEQ L10577 - false * Goal 315. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_69()Z: I167 Branch 3882 IFEQ L10579 - false * Goal 316. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_16()Z: I7 Branch 3883 IFEQ L10597 - false * Goal 317. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_15()Z: I8 Branch 3891 IFEQ L10644 - false * Goal 318. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_104()Z: I7 Branch 3895 IFEQ L10669 - true * Goal 319. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_76()Z: I13 Branch 3896 IFEQ L10678 - false * Goal 320. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_76()Z: I26 Branch 3897 IFEQ L10680 - true * Goal 321. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I13 Branch 3899 IFEQ L10697 - false * Goal 322. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I27 Branch 3900 IFEQ L10699 - false * Goal 323. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I41 Branch 3901 IFEQ L10701 - false * Goal 324. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I55 Branch 3902 IFEQ L10703 - false * Goal 325. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I69 Branch 3903 IFEQ L10705 - false * Goal 326. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I83 Branch 3904 IFEQ L10707 - false * Goal 327. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I97 Branch 3905 IFEQ L10709 - false * Goal 328. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_74()Z: I111 Branch 3906 IFEQ L10711 - false * Goal 329. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_11()Z: I8 Branch 3909 IFEQ L10735 - false * Goal 330. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_12()Z: I7 Branch 3920 IFEQ L10796 - false * Goal 331. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_68()Z: I8 Branch 3926 IFEQ L10832 - false * Goal 332. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3_13()Z: I8 Branch 3930 IFEQ L10853 - false * Goal 333. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_123()Z: I8 Branch 3933 IFEQ L10868 - true * Goal 334. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_123()Z: I25 Branch 3934 IFEQ L10873 - false * Goal 335. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_3R_123()Z: I43 Branch 3935 IFEQ L10877 - false * Goal 336. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I11 Branch 3936 IFNULL L10939 - false * Goal 337. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I48 Branch 3937 IF_ICMPLT L10947 - false * Goal 338. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I56 Branch 3938 IF_ICMPGT L10947 - false * Goal 339. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I64 Branch 3939 IFNULL L10948 - false * Goal 340. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I74 Branch 3940 IF_ICMPNE L10954 - false * Goal 341. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I9 Branch 3941 IF_ACMPNE L10970 - true * Goal 342. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I9 Branch 3941 IF_ACMPNE L10970 - false * Goal 343. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I26 Branch 3942 IFNONNULL L10972 - true * Goal 344. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I26 Branch 3942 IFNONNULL L10972 - false * Goal 345. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I75 Branch 3943 IF_ICMPEQ L10981 - true * Goal 346. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I75 Branch 3943 IF_ICMPEQ L10981 - false * Goal 347. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_scan_token(I)Z: I87 Branch 3944 IFNE L10984 - true * Goal 348. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I7 Branch 3947 IFEQ L11001 - false * Goal 349. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I29 Branch 3948 IF_ICMPGE L11002 - true * Goal 350. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I29 Branch 3948 IF_ICMPGE L11002 - false * Goal 351. com.soops.CEN4010.JMCA.JParser.JavaParser.getToken(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I37 Branch 3949 IFNULL L11003 - false * Goal 352. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_ntk()I: I11 Branch 3950 IFNONNULL L11013 - true * Goal 353. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_ntk()I: I11 Branch 3950 IFNONNULL L11013 - false */ @Test public void test75() throws Throwable { StringBufferInputStream stringBufferInputStream0 = new StringBufferInputStream("nutmeg"); assertEquals(6, stringBufferInputStream0.available()); assertNotNull(stringBufferInputStream0); JavaParser javaParser0 = new JavaParser((InputStream) stringBufferInputStream0); assertEquals(6, stringBufferInputStream0.available()); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); javaParser0.ArgumentList(); assertEquals(0, stringBufferInputStream0.available()); assertFalse(javaParser0.lookingAhead); JavaParser javaParser1 = new JavaParser((InputStream) stringBufferInputStream0); assertEquals(0, stringBufferInputStream0.available()); assertFalse(javaParser1.lookingAhead); assertFalse(javaParser1.equals((Object)javaParser0)); assertNotNull(javaParser1); assertNotSame(javaParser1, javaParser0); JavaParser javaParser2 = new JavaParser(javaParser0.token_source); assertEquals(0, stringBufferInputStream0.available()); assertFalse(javaParser2.lookingAhead); assertFalse(javaParser0.lookingAhead); assertFalse(javaParser2.equals((Object)javaParser0)); assertFalse(javaParser2.equals((Object)javaParser1)); assertFalse(javaParser0.equals((Object)javaParser1)); assertFalse(javaParser0.equals((Object)javaParser2)); assertNotNull(javaParser2); assertNotSame(javaParser2, javaParser0); assertNotSame(javaParser2, javaParser1); assertNotSame(javaParser0, javaParser1); assertNotSame(javaParser0, javaParser2); try { javaParser1.SwitchLabel(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 76 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.FormalParameters()V: I127 Branch 708 IFEQ L1746 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.FormalParameters()V: I155 Branch 709 IFEQ L1752 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.FormalParameters()V: I168 Branch 710 IFEQ L1759 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.FormalParameters()V: I187 Branch 711 IFEQ L1772 - true */ @Test public void test76() throws Throwable { JavaParser javaParser0 = new JavaParser(" rava JavaParser inputZile"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.FormalParameters(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 77 /* * 4 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArguments()V: I107 Branch 950 IFEQ L2292 - false * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArguments()V: I135 Branch 951 IFEQ L2298 - true * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArguments()V: I148 Branch 952 IFEQ L2305 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.TypeArguments()V: I167 Branch 953 IFEQ L2318 - true */ @Test public void test77() throws Throwable { JavaParser javaParser0 = new JavaParser("GU0u-Hs%*."); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.TypeArguments(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 78 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isPrivate(I)Z: I8 Branch 3954 IFEQ L61 - true */ @Test public void test78() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isPrivate((-3048)); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertFalse(boolean0); } //Test case number: 79 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.Name()V: I75 Branch 1015 IFEQ L2559 - false */ @Test public void test79() throws Throwable { JavaParser javaParser0 = new JavaParser("-"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.Name(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } //Test case number: 80 /* * 1 covered goal: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isVolatile(I)Z: I8 Branch 3962 IFEQ L93 - true */ @Test public void test80() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isVolatile((int) 'b'); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(16, javaParser_ModifierSet0.STATIC); assertFalse(boolean0); } //Test case number: 81 /* * 2 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.<init>()V: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser$ModifierSet.isPublic(I)Z: I8 Branch 3952 IFEQ L53 - true */ @Test public void test81() throws Throwable { JavaParser.ModifierSet javaParser_ModifierSet0 = new JavaParser.ModifierSet(); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertNotNull(javaParser_ModifierSet0); boolean boolean0 = javaParser_ModifierSet0.isPublic(0); assertEquals(4, javaParser_ModifierSet0.PRIVATE); assertEquals(8, javaParser_ModifierSet0.ABSTRACT); assertEquals(2, javaParser_ModifierSet0.PROTECTED); assertEquals(32, javaParser_ModifierSet0.FINAL); assertEquals(16, javaParser_ModifierSet0.STATIC); assertEquals(1, javaParser_ModifierSet0.PUBLIC); assertEquals(64, javaParser_ModifierSet0.SYNCHRONIZED); assertEquals(512, javaParser_ModifierSet0.VOLATILE); assertEquals(256, javaParser_ModifierSet0.TRANSIENT); assertEquals(128, javaParser_ModifierSet0.NATIVE); assertEquals(4096, javaParser_ModifierSet0.STRICTFP); assertFalse(boolean0); } //Test case number: 82 /* * 10 covered goals: * Goal 1. com.soops.CEN4010.JMCA.JParser.JavaParser.<init>(Ljava/lang/String;)V: root-Branch * Goal 2. com.soops.CEN4010.JMCA.JParser.JavaParser.<init>(Ljava/io/InputStream;)V: root-Branch * Goal 3. com.soops.CEN4010.JMCA.JParser.JavaParser.PackageDeclaration()V: I61 Branch 33 IFEQ L256 - false * Goal 4. com.soops.CEN4010.JMCA.JParser.JavaParser.PackageDeclaration()V: I89 Branch 34 IFEQ L262 - true * Goal 5. com.soops.CEN4010.JMCA.JParser.JavaParser.PackageDeclaration()V: I102 Branch 35 IFEQ L269 - false * Goal 6. com.soops.CEN4010.JMCA.JParser.JavaParser.PackageDeclaration()V: I121 Branch 36 IFEQ L282 - true * Goal 7. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I11 Branch 3936 IFNULL L10939 - true * Goal 8. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I48 Branch 3937 IF_ICMPLT L10947 - true * Goal 9. com.soops.CEN4010.JMCA.JParser.JavaParser.jj_consume_token(I)Lcom/soops/CEN4010/JMCA/JParser/Token;: I74 Branch 3940 IF_ICMPNE L10954 - true * Goal 10. com.soops.CEN4010.JMCA.JParser.JavaParser.generateParseException()Lcom/soops/CEN4010/JMCA/JParser/ParseException;: I22 Branch 3951 IFNE L11023 - false */ @Test public void test82() throws Throwable { JavaParser javaParser0 = new JavaParser("~W,GV+B'b0"); assertFalse(javaParser0.lookingAhead); assertNotNull(javaParser0); try { javaParser0.PackageDeclaration(); fail("Expecting exception: Exception"); } catch(Exception e) { // // Parse error at line 1, column 0. Encountered: <EOF> // } } }
59.240317
164
0.733818
e484185e12d7eaf440487ec81d9dc31fb1aef498
7,173
package co.edu.uniandes.csw.partyServices.resources; import co.edu.uniandes.csw.partyServices.dtos.PagoDTO; import co.edu.uniandes.csw.partyServices.ejb.PagoLogic; import co.edu.uniandes.csw.partyServices.entities.PagoEntity; import co.edu.uniandes.csw.partyServices.exceptions.BusinessLogicException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; /** * Clase que implementa el recurso "pagos". * * @author ELias Negrete * @version 1.0 */ @Produces("application/json") @Consumes("application/json") public class PagoResource { private static final Logger LOGGER = Logger.getLogger(PagoResource.class.getName()); @Inject private PagoLogic pagoLogic; private static final String RECURSO_CLIENTES = "El recurso /clientes/"; private static final String RECURSO_PAGO = "/pagos/"; private static final String NO_EXISTE = " no existe."; /** * Crea una nuevo pago con la informacion que se recibe en el cuerpo de la * petición y se regresa un objeto identico con un id auto-generado por la * base de datos. * * @param clientesId El ID del cliente del cual se le agrega la pago * @param pago {@link PagoDTO} - La pago que se desea guardar. * @return JSON {@link PagoDTO} - La pago guardada con el atributo id * autogenerado. * @throws BusinessLogicException {@link BusinessLogicExceptionMapper} - * Error de lógica que se genera cuando ya existe la pago. */ @POST public PagoDTO createPago(@PathParam("clientesId") Long clientesId, PagoDTO pago) throws BusinessLogicException { LOGGER.log(Level.INFO, "PagoResource createPago: input: {0}", pago); PagoDTO nuevoDTO = new PagoDTO(pagoLogic.createPago(clientesId, pago.toEntity())); LOGGER.log(Level.INFO, "PagoResource createPago: output: {0}", nuevoDTO); return nuevoDTO; } /** * Busca y devuelve todas las pagos que existen en un cliente. * * @param clientesId El ID del libro del cual se buscan las reseñas * @return JSONArray {@link PagoDTO} - Las reseñas encontradas en el libro. * Si no hay ninguna retorna una lista vacía. */ @GET public List<PagoDTO> getPagos(@PathParam("clientesId") Long clientesId) { LOGGER.log(Level.INFO, "PagoResource getPagos: input: {0}", clientesId); List<PagoDTO> listaDTOs = listEntity2DTO(pagoLogic.getPagos(clientesId)); LOGGER.log(Level.INFO, "PagoResource getPagos: output: {0}", listaDTOs); return listaDTOs; } /** * Busca y devuelve la pago con el ID recibido en la URL, relativa a un * cliente. * * @param clientesId El ID del cliente del cual se buscan las pagos * @param pagosId El ID de la pago que se busca * @return {@link PagoDTO} - La pago encontradas en el cliente. * @throws BusinessLogicException {@link BusinessLogicExceptionMapper} - * Error de lógica que se genera cuando no se encuentra el cliente. * @throws WebApplicationException {@link WebApplicationExceptionMapper} - * Error de lógica que se genera cuando no se encuentra la pago. */ @GET @Path("{pagosId: \\d+}") public PagoDTO getPago(@PathParam("clientesId") Long clientesId, @PathParam("pagosId") Long pagosId) throws BusinessLogicException { LOGGER.log(Level.INFO, "PagoResource getPago: input: id : {0}", pagosId); PagoEntity entity = pagoLogic.getPago(clientesId, pagosId); if (entity == null) { throw new WebApplicationException(RECURSO_CLIENTES + clientesId + RECURSO_PAGO + pagosId + NO_EXISTE, 404); } PagoDTO pagoDTO = new PagoDTO(entity); LOGGER.log(Level.INFO, "PagoResource getPago: output: cliente: {0}", pagoDTO); return pagoDTO; } /** * Actualiza un pago con la informacion que se recibe en el cuerpo de la * petición y se regresa el objeto actualizado. * * @param clientesId El ID del cliente del cual se guarda la reseña * @param pagosId El ID de la pago que se va a actualizar * @param pago {@link PagoDTO} - La pago que se desea guardar. * @return JSON {@link PagoDTO} - La pago actualizada. * @throws BusinessLogicException {@link BusinessLogicExceptionMapper} - * Error de lógica que se genera cuando ya existe la pago. * @throws WebApplicationException {@link WebApplicationExceptionMapper} - * Error de lógica que se genera cuando no se encuentra la pago. */ @PUT @Path("{pagosId: \\d+}") public PagoDTO updatePago(@PathParam("clientesId") Long clientesId, @PathParam("pagosId") Long pagosId, PagoDTO pago) throws BusinessLogicException { LOGGER.log(Level.INFO, "Resource update: input: clientesId: {0} , pagosId: {1} , pago:{2}", new Object[]{clientesId, pagosId, pago}); PagoEntity entity = pagoLogic.getPago(clientesId, pagosId); if (entity == null) { throw new WebApplicationException("El recurso /clientes/" + clientesId + "/pagos/" + pagosId + " no existe.", 404); } PagoDTO pagoDTO = new PagoDTO(pagoLogic.updatePago(clientesId, pago.toEntity())); LOGGER.log(Level.INFO, "Resource update: output:{0}", pagoDTO); return pagoDTO; } /** * Borra el pago con el id asociado recibido en la URL. * * @param clientesId El ID del cliente del cual se va a eliminar la reseña. * @param pagosId El ID de la pago que se va a eliminar. * @throws BusinessLogicException {@link BusinessLogicExceptionMapper} - * Error de lógica que se genera cuando no se puede eliminar la pago. * @throws WebApplicationException {@link WebApplicationExceptionMapper} - * Error de lógica que se genera cuando no se encuentra la pago. */ @DELETE @Path("{pagosId: \\d+}") public void deletePago(@PathParam("clientesId") Long clientesId, @PathParam("pagosId") Long pagosId) throws BusinessLogicException { PagoEntity entity = pagoLogic.getPago(clientesId, pagosId); if (entity == null) { throw new WebApplicationException("El recurso /clientes/" + clientesId + "/pagos/" + pagosId + " no existe.", 404); } pagoLogic.deletePago(clientesId, pagosId); } /** * Lista de entidades a DTO. * * Este método convierte una lista de objetos PagoEntity a una lista de * objetos PagoDTO (json) * * @param entityList corresponde a la lista de pagos de tipo Entity que * vamos a convertir a DTO. * @return la lista de pagos en forma DTO (json) */ private List<PagoDTO> listEntity2DTO(List<PagoEntity> entityList) { List<PagoDTO> list = new ArrayList<>(); for (PagoEntity entity : entityList) { list.add(new PagoDTO(entity)); } return list; } }
41.947368
153
0.680608
09178a8bf8b1eef3f64fdeac1023d39d105b9683
2,273
/* * Agave * * This file was automatically generated for Agave Platform Client SDK by APIMATIC BETA v2.0 on 05/20/2016 */ package org.agave.client.models; import java.util.*; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonSetter; public class ApplicationPublishAction extends ApplicationAction { private static final long serialVersionUID = 4959132020571823879L; private ApplicationActionTypeEnum action = ApplicationActionTypeEnum.fromString("PUBLISH"); private String executionSystem; private String name; private String version; /** GETTER * TODO: Write general description for this method */ @JsonGetter("action") public ApplicationActionTypeEnum getAction ( ) { return this.action; } /** SETTER * TODO: Write general description for this method */ @JsonSetter("action") private void setAction (ApplicationActionTypeEnum value) { this.action = value; } /** GETTER * The id of the public system on which this app will run after publication */ @JsonGetter("executionSystem") public String getExecutionSystem ( ) { return this.executionSystem; } /** SETTER * The id of the public system on which this app will run after publication */ @JsonSetter("executionSystem") public void setExecutionSystem (String value) { this.executionSystem = value; } /** GETTER * The new name of the app after publication */ @JsonGetter("name") public String getName ( ) { return this.name; } /** SETTER * The new name of the app after publication */ @JsonSetter("name") public void setName (String value) { this.name = value; } /** GETTER * The new version of the app after publication */ @JsonGetter("version") public String getVersion ( ) { return this.version; } /** SETTER * The new version of the app after publication */ @JsonSetter("version") public void setVersion (String value) { this.version = value; } }
27.059524
107
0.622085
e00e204701ba6eece5ed73e0753b6c1a8f0188eb
15,197
/* * Copyright (C) 2015 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.android.sdklib.repository.targets; import static org.junit.Assert.assertArrayEquals; import com.android.annotations.NonNull; import com.android.repository.testframework.FakeProgressIndicator; import com.android.repository.testframework.MockFileOp; import com.android.sdklib.ISystemImage; import com.android.sdklib.repository.AndroidSdkHandler; import com.android.testutils.file.InMemoryFileSystems; import com.google.common.collect.Sets; import java.nio.file.Path; import java.util.Iterator; import java.util.Set; import junit.framework.TestCase; /** * Tests for {@link SystemImageManager} */ public class SystemImageManagerTest extends TestCase { // TODO: break up tests into separate cases public void testSystemImageManager() { MockFileOp fop = new MockFileOp(); recordPlatform13(fop); recordGoogleTvAddon13(fop); recordGoogleApisSysImg23(fop); recordSysImg23(fop); recordGoogleApis13(fop); AndroidSdkHandler handler = new AndroidSdkHandler(fop.toPath("/sdk"), null, fop); FakeProgressIndicator progress = new FakeProgressIndicator(); SystemImageManager mgr = new SystemImageManager( handler.getSdkManager(progress), AndroidSdkHandler.getSysImgModule().createLatestFactory()); Set<SystemImage> images = Sets.newTreeSet(mgr.getImages()); progress.assertNoErrorsOrWarnings(); assertEquals(5, images.size()); Iterator<SystemImage> resultIter = images.iterator(); ISystemImage platform13 = resultIter.next(); verifyPlatform13(platform13, handler); assertEquals(2, platform13.getSkins().length); verifySysImg23(resultIter.next(), handler); ISystemImage google13 = resultIter.next(); verifyGoogleAddon13(google13); assertEquals(2, google13.getSkins().length); ISystemImage google23 = resultIter.next(); verifyGoogleApisSysImg23(google23, handler); ISystemImage addon13 = resultIter.next(); verifyTvAddon13(addon13, handler); assertEquals("google_tv_addon", addon13.getTag().getId()); } private @NonNull Path toPath(@NonNull String path, @NonNull AndroidSdkHandler sdkHandler) { return sdkHandler.toCompatiblePath(InMemoryFileSystems.getPlatformSpecificPath(path)); } private void verifyGoogleAddon13(ISystemImage img) { // Nothing, just here for consistency. Note the new implementation will pick up skins from // the platform. } private void verifyPlatform13(@NonNull ISystemImage img, @NonNull AndroidSdkHandler sdk) { assertEquals("armeabi", img.getAbiType()); assertNull(img.getAddonVendor()); assertEquals(toPath("/sdk/platforms/android-13/images/", sdk), img.getLocation()); assertEquals("default", img.getTag().getId()); } private void verifyTvAddon13(@NonNull ISystemImage img, @NonNull AndroidSdkHandler sdk) { assertEquals("x86", img.getAbiType()); assertEquals("google", img.getAddonVendor().getId()); assertEquals( toPath("/sdk/add-ons/addon-google_tv_addon-google-13/images/x86/", sdk), img.getLocation()); } private void verifyGoogleApisSysImg23( @NonNull ISystemImage img, @NonNull AndroidSdkHandler sdk) { assertEquals("x86_64", img.getAbiType()); assertEquals("google", img.getAddonVendor().getId()); assertEquals( toPath("/sdk/system-images/android-23/google_apis/x86_64/", sdk), img.getLocation()); assertEquals("google_apis", img.getTag().getId()); } private void verifySysImg23(@NonNull ISystemImage img, @NonNull AndroidSdkHandler sdk) { assertEquals("x86", img.getAbiType()); assertNull(img.getAddonVendor()); assertEquals( toPath("/sdk/system-images/android-23/default/x86/", sdk), img.getLocation()); assertEquals(2, img.getSkins().length); assertArrayEquals( new Path[] { toPath("/sdk/system-images/android-23/default/x86/skins/res1/", sdk), toPath("/sdk/system-images/android-23/default/x86/skins/res2/", sdk) }, img.getSkins()); assertEquals("default", img.getTag().getId()); } private static void recordPlatform13(MockFileOp fop) { fop.recordExistingFile("/sdk/platforms/android-13/images/system.img"); fop.recordExistingFile("/sdk/platforms/android-13/android.jar"); fop.recordExistingFile("/sdk/platforms/android-13/framework.aidl"); fop.recordExistingFile("/sdk/platforms/android-13/skins/HVGA/layout"); fop.recordExistingFile("/sdk/platforms/android-13/skins/sample.txt"); fop.recordExistingFile("/sdk/platforms/android-13/skins/WVGA800/layout"); fop.recordExistingFile("/sdk/platforms/android-13/sdk.properties", "sdk.ant.templates.revision=1\n" + "sdk.skin.default=WXGA\n"); fop.recordExistingFile("/sdk/platforms/android-13/package.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<ns2:sdk-repository " + "xmlns:ns2=\"http://schemas.android.com/sdk/android/repo/repository2/01\" " + "xmlns:ns3=\"http://schemas.android.com/sdk/android/repo/sys-img2/01\" " + "xmlns:ns4=\"http://schemas.android.com/repository/android/common/01\" " + "xmlns:ns5=\"http://schemas.android.com/sdk/android/repo/addon2/01\">" + "<license id=\"license-2A86BE32\" type=\"text\">License Text\n</license>" + "<localPackage path=\"platforms;android-13\" obsolete=\"false\">" + "<type-details xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:type=\"ns2:platformDetailsType\"><api-level>13</api-level>" + "<layoutlib api=\"4\"/></type-details><revision><major>1</major>" + "</revision><display-name>API 13: Android 3.2 (Honeycomb)</display-name>" + "<uses-license ref=\"license-2A86BE32\"/><dependencies>" + "<dependency path=\"tools\"><min-revision><major>12</major></min-revision>" + "</dependency></dependencies></localPackage></ns2:sdk-repository>"); } private static void recordGoogleTvAddon13(MockFileOp fop) { fop.recordExistingFile("/sdk/add-ons/addon-google_tv_addon-google-13/package.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<ns5:sdk-addon xmlns:ns2=\"http://schemas.android.com/sdk/android/repo/repository2/01\" " + "xmlns:ns3=\"http://schemas.android.com/sdk/android/repo/sys-img2/01\" " + "xmlns:ns4=\"http://schemas.android.com/repository/android/common/01\" " + "xmlns:ns5=\"http://schemas.android.com/sdk/android/repo/addon2/01\">" + "<license id=\"license-A06C75BE\" type=\"text\">Terms and Conditions\n" + "</license><localPackage " + "path=\"add-ons;addon-google_tv_addon-google-13\" obsolete=\"false\">" + "<type-details xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:type=\"ns5:addonDetailsType\"><api-level>13</api-level>" + "<vendor><id>google</id><display>Google Inc.</display></vendor>" + "<tag><id>google_tv_addon</id><display>Google TV Addon</display></tag>" + "<default-skin>720p</default-skin>" + "</type-details><revision><major>1</major><minor>0</minor>" + "<micro>0</micro></revision>" + "<display-name>Google TV Addon, Android 13</display-name>" + "<uses-license ref=\"license-A06C75BE\"/></localPackage>" + "</ns5:sdk-addon>\n"); fop.recordExistingFile("/sdk/add-ons/addon-google_tv_addon-google-13/skins/1080p/layout"); fop.recordExistingFile("/sdk/add-ons/addon-google_tv_addon-google-13/skins/sample.txt"); fop.recordExistingFile("/sdk/add-ons/addon-google_tv_addon-google-13/skins/720p-overscan/layout"); fop.recordExistingFile("/sdk/add-ons/addon-google_tv_addon-google-13/images/x86/system.img"); } private static void recordSysImg23(MockFileOp fop) { fop.recordExistingFile("/sdk/system-images/android-23/default/x86/system.img"); fop.recordExistingFile("/sdk/system-images/android-23/default/x86/skins/res1/layout"); fop.recordExistingFile("/sdk/system-images/android-23/default/x86/skins/sample"); fop.recordExistingFile("/sdk/system-images/android-23/default/x86/skins/res2/layout"); fop.recordExistingFile("/sdk/system-images/android-23/default/x86/package.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<ns3:sdk-sys-img " + "xmlns:ns2=\"http://schemas.android.com/sdk/android/repo/repository2/01\" " + "xmlns:ns3=\"http://schemas.android.com/sdk/android/repo/sys-img2/01\" " + "xmlns:ns4=\"http://schemas.android.com/repository/android/common/01\" " + "xmlns:ns5=\"http://schemas.android.com/sdk/android/repo/addon2/01\">" + "<license id=\"license-A78C4257\" type=\"text\">Terms and Conditions\n" + "</license><localPackage path=\"system-images;android-23;default;x86\" " + "obsolete=\"false\">" + "<type-details xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:type=\"ns3:sysImgDetailsType\"><api-level>23</api-level>" + "<tag><id>default</id><display>Default</display></tag><abi>x86</abi>" + "</type-details><revision><major>5</major></revision>" + "<display-name>Intel x86 Atom System Image</display-name>" + "<uses-license ref=\"license-A78C4257\"/></localPackage>" + "</ns3:sdk-sys-img>\n"); } private static void recordGoogleApisSysImg23(MockFileOp fop) { fop.recordExistingFile("/sdk/system-images/android-23/google_apis/x86_64/system.img"); fop.recordExistingFile("/sdk/system-images/android-23/google_apis/x86_64/package.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<ns3:sdk-sys-img " + "xmlns:ns2=\"http://schemas.android.com/sdk/android/repo/repository2/01\" " + "xmlns:ns3=\"http://schemas.android.com/sdk/android/repo/sys-img2/01\" " + "xmlns:ns4=\"http://schemas.android.com/repository/android/common/01\" " + "xmlns:ns5=\"http://schemas.android.com/sdk/android/repo/addon2/01\">" + "<license id=\"license-9A5C00D5\" type=\"text\">Terms and Conditions\n" + "</license><localPackage " + "path=\"system-images;android-23;google_apis;x86_64\" " + "obsolete=\"false\"><type-details " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:type=\"ns3:sysImgDetailsType\"><api-level>23</api-level>" + "<tag><id>google_apis</id><display>Google APIs</display></tag>" + "<vendor><id>google</id><display>Google Inc.</display></vendor>" + "<abi>x86_64</abi></type-details><revision><major>9</major></revision>" + "<display-name>Google APIs Intel x86 Atom_64 System Image</display-name>" + "<uses-license ref=\"license-9A5C00D5\"/></localPackage>" + "</ns3:sdk-sys-img>\n"); } private static void recordGoogleApis13(MockFileOp fop) { fop.recordExistingFile("/sdk/add-ons/addon-google_apis-google-13/images/system.img"); fop.recordExistingFile("/sdk/add-ons/addon-google_apis-google-13/package.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<ns5:sdk-addon " + "xmlns:ns2=\"http://schemas.android.com/sdk/android/repo/repository2/01\" " + "xmlns:ns3=\"http://schemas.android.com/sdk/android/repo/sys-img2/01\" " + "xmlns:ns4=\"http://schemas.android.com/repository/android/common/01\" " + "xmlns:ns5=\"http://schemas.android.com/sdk/android/repo/addon2/01\">\n" + "<license id=\"license-DB79309F\" type=\"text\">\n" + "Terms and Conditions\n" + "</license>\n" + "<localPackage path=\"add-ons;addon-google_apis-google-13\" " + "obsolete=\"false\">\n" + "<type-details xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:type=\"ns5:addonDetailsType\">\n" + "<api-level>13</api-level>\n" + "<vendor>\n" + "<id>google</id>\n" + "<display>Google Inc.</display>\n" + "</vendor>\n" + "<tag>\n" + "<id>google_apis</id>\n" + "<display>\n" + "Google APIs</display>\n" + "</tag>\n" + "</type-details>\n" + "<revision>\n" + "<major>1</major>\n" + "<minor>0</minor>\n" + "<micro>0</micro>\n" + "</revision>\n" + "<display-name>Google APIs, Android 13</display-name>\n" + "<uses-license ref=\"license-DB79309F\"/>\n" + "</localPackage>\n" + "</ns5:sdk-addon>\n"); } }
56.285185
116
0.574192
971719b997055102b90dba26d303f77dc52f2050
449
package abstractclasses; import java.util.ArrayList; public class AbstractClasses { public static void main(String[] args) { // you can create an instance of an abstract class // BankAccount account = new BankAccount("Eric"); ArrayList<BankAccount> accounts = new ArrayList<BankAccount>(); accounts.add(new SavingsAccount("Eric")); accounts.add(new CertificateOfDeposit(("Eric"), .05, 12)); } }
24.944444
71
0.670379
f2b1950fcc69b2d96becad2ee62aa2f9a14fa3d5
705
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true" import java.util.*; import static java.util.Arrays.asList; public class Main { public static boolean test(List<List<String>> list) { return list.stream().filter(x -> x != null).flatMap(x -> x.stream()).anyMat<caret>ch(x -> x.startsWith("a")); } String testTernary(String[] strings) { return Arrays.stream(strings).filter(Objects::nonNull).anyMatch(s -> !s.startsWith("xyz")) ? "s" : null; } public static void main(String[] args) { System.out.println(test(asList(asList(), asList("a"), asList("b", "c")))); System.out.println(test(asList(asList(), asList("d"), asList("b", "c")))); } }
35.25
113
0.653901
ddccf87c951d7fc30f06d52320620ea775e27219
61,206
/* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.java.util.jar.pack; import java.util.AbstractList; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Set; import static com.sun.java.util.jar.pack.Constants.*; /** * Representation of constant pool entries and indexes. * @author John Rose */ abstract class ConstantPool { private ConstantPool() {} // do not instantiate static int verbose() { return Utils.currentPropMap().getInteger(Utils.DEBUG_VERBOSE); } /** Factory for Utf8 string constants. * Used for well-known strings like "SourceFile", "<init>", etc. * Also used to back up more complex constant pool entries, like Class. */ public static synchronized Utf8Entry getUtf8Entry(String value) { Map<String, Utf8Entry> utf8Entries = Utils.getTLGlobals().getUtf8Entries(); Utf8Entry e = utf8Entries.get(value); if (e == null) { e = new Utf8Entry(value); utf8Entries.put(e.stringValue(), e); } return e; } /** Factory for Class constants. */ public static ClassEntry getClassEntry(String name) { Map<String, ClassEntry> classEntries = Utils.getTLGlobals().getClassEntries(); ClassEntry e = classEntries.get(name); if (e == null) { e = new ClassEntry(getUtf8Entry(name)); assert(name.equals(e.stringValue())); classEntries.put(e.stringValue(), e); } return e; } /** Factory for literal constants (String, Integer, etc.). */ public static LiteralEntry getLiteralEntry(Comparable<?> value) { Map<Object, LiteralEntry> literalEntries = Utils.getTLGlobals().getLiteralEntries(); LiteralEntry e = literalEntries.get(value); if (e == null) { if (value instanceof String) e = new StringEntry(getUtf8Entry((String)value)); else e = new NumberEntry((Number)value); literalEntries.put(value, e); } return e; } /** Factory for literal constants (String, Integer, etc.). */ public static StringEntry getStringEntry(String value) { return (StringEntry) getLiteralEntry(value); } /** Factory for signature (type) constants. */ public static SignatureEntry getSignatureEntry(String type) { Map<String, SignatureEntry> signatureEntries = Utils.getTLGlobals().getSignatureEntries(); SignatureEntry e = signatureEntries.get(type); if (e == null) { e = new SignatureEntry(type); assert(e.stringValue().equals(type)); signatureEntries.put(type, e); } return e; } // Convenience overloading. public static SignatureEntry getSignatureEntry(Utf8Entry formRef, ClassEntry[] classRefs) { return getSignatureEntry(SignatureEntry.stringValueOf(formRef, classRefs)); } /** Factory for descriptor (name-and-type) constants. */ public static DescriptorEntry getDescriptorEntry(Utf8Entry nameRef, SignatureEntry typeRef) { Map<String, DescriptorEntry> descriptorEntries = Utils.getTLGlobals().getDescriptorEntries(); String key = DescriptorEntry.stringValueOf(nameRef, typeRef); DescriptorEntry e = descriptorEntries.get(key); if (e == null) { e = new DescriptorEntry(nameRef, typeRef); assert(e.stringValue().equals(key)) : (e.stringValue()+" != "+(key)); descriptorEntries.put(key, e); } return e; } // Convenience overloading. public static DescriptorEntry getDescriptorEntry(Utf8Entry nameRef, Utf8Entry typeRef) { return getDescriptorEntry(nameRef, getSignatureEntry(typeRef.stringValue())); } /** Factory for member reference constants. */ public static MemberEntry getMemberEntry(byte tag, ClassEntry classRef, DescriptorEntry descRef) { Map<String, MemberEntry> memberEntries = Utils.getTLGlobals().getMemberEntries(); String key = MemberEntry.stringValueOf(tag, classRef, descRef); MemberEntry e = memberEntries.get(key); if (e == null) { e = new MemberEntry(tag, classRef, descRef); assert(e.stringValue().equals(key)) : (e.stringValue()+" != "+(key)); memberEntries.put(key, e); } return e; } /** Factory for MethodHandle constants. */ public static MethodHandleEntry getMethodHandleEntry(byte refKind, MemberEntry memRef) { Map<String, MethodHandleEntry> methodHandleEntries = Utils.getTLGlobals().getMethodHandleEntries(); String key = MethodHandleEntry.stringValueOf(refKind, memRef); MethodHandleEntry e = methodHandleEntries.get(key); if (e == null) { e = new MethodHandleEntry(refKind, memRef); assert(e.stringValue().equals(key)); methodHandleEntries.put(key, e); } return e; } /** Factory for MethodType constants. */ public static MethodTypeEntry getMethodTypeEntry(SignatureEntry sigRef) { Map<String, MethodTypeEntry> methodTypeEntries = Utils.getTLGlobals().getMethodTypeEntries(); String key = sigRef.stringValue(); MethodTypeEntry e = methodTypeEntries.get(key); if (e == null) { e = new MethodTypeEntry(sigRef); assert(e.stringValue().equals(key)); methodTypeEntries.put(key, e); } return e; } public static MethodTypeEntry getMethodTypeEntry(Utf8Entry typeRef) { return getMethodTypeEntry(getSignatureEntry(typeRef.stringValue())); } /** Factory for InvokeDynamic constants. */ public static InvokeDynamicEntry getInvokeDynamicEntry(BootstrapMethodEntry bssRef, DescriptorEntry descRef) { Map<String, InvokeDynamicEntry> invokeDynamicEntries = Utils.getTLGlobals().getInvokeDynamicEntries(); String key = InvokeDynamicEntry.stringValueOf(bssRef, descRef); InvokeDynamicEntry e = invokeDynamicEntries.get(key); if (e == null) { e = new InvokeDynamicEntry(bssRef, descRef); assert(e.stringValue().equals(key)); invokeDynamicEntries.put(key, e); } return e; } /** Factory for BootstrapMethod pseudo-constants. */ public static BootstrapMethodEntry getBootstrapMethodEntry(MethodHandleEntry bsmRef, Entry[] argRefs) { Map<String, BootstrapMethodEntry> bootstrapMethodEntries = Utils.getTLGlobals().getBootstrapMethodEntries(); String key = BootstrapMethodEntry.stringValueOf(bsmRef, argRefs); BootstrapMethodEntry e = bootstrapMethodEntries.get(key); if (e == null) { e = new BootstrapMethodEntry(bsmRef, argRefs); assert(e.stringValue().equals(key)); bootstrapMethodEntries.put(key, e); } return e; } /** Entries in the constant pool. */ public abstract static class Entry implements Comparable<Object> { protected final byte tag; // a CONSTANT_foo code protected int valueHash; // cached hashCode protected Entry(byte tag) { this.tag = tag; } public final byte getTag() { return tag; } public final boolean tagEquals(int tag) { return getTag() == tag; } public Entry getRef(int i) { return null; } public boolean eq(Entry that) { // same reference assert(that != null); return this == that || this.equals(that); } // Equality of Entries is value-based. public abstract boolean equals(Object o); public final int hashCode() { if (valueHash == 0) { valueHash = computeValueHash(); if (valueHash == 0) valueHash = 1; } return valueHash; } protected abstract int computeValueHash(); public abstract int compareTo(Object o); protected int superCompareTo(Object o) { Entry that = (Entry) o; if (this.tag != that.tag) { return TAG_ORDER[this.tag] - TAG_ORDER[that.tag]; } return 0; // subclasses must refine this } public final boolean isDoubleWord() { return tag == CONSTANT_Double || tag == CONSTANT_Long; } public final boolean tagMatches(int matchTag) { if (tag == matchTag) return true; byte[] allowedTags; switch (matchTag) { case CONSTANT_All: return true; case CONSTANT_Signature: return tag == CONSTANT_Utf8; // format check also? case CONSTANT_LoadableValue: allowedTags = LOADABLE_VALUE_TAGS; break; case CONSTANT_AnyMember: allowedTags = ANY_MEMBER_TAGS; break; case CONSTANT_FieldSpecific: allowedTags = FIELD_SPECIFIC_TAGS; break; default: return false; } for (byte b : allowedTags) { if (b == tag) return true; } return false; } public String toString() { String valuePrint = stringValue(); if (verbose() > 4) { if (valueHash != 0) valuePrint += " hash="+valueHash; valuePrint += " id="+System.identityHashCode(this); } return tagName(tag)+"="+valuePrint; } public abstract String stringValue(); } public static class Utf8Entry extends Entry { final String value; Utf8Entry(String value) { super(CONSTANT_Utf8); this.value = value.intern(); hashCode(); // force computation of valueHash } protected int computeValueHash() { return value.hashCode(); } public boolean equals(Object o) { // Use reference equality of interned strings: return (o != null && o.getClass() == Utf8Entry.class && ((Utf8Entry) o).value.equals(value)); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { x = value.compareTo(((Utf8Entry)o).value); } return x; } public String stringValue() { return value; } } static boolean isMemberTag(byte tag) { switch (tag) { case CONSTANT_Fieldref: case CONSTANT_Methodref: case CONSTANT_InterfaceMethodref: return true; } return false; } static byte numberTagOf(Number value) { if (value instanceof Integer) return CONSTANT_Integer; if (value instanceof Float) return CONSTANT_Float; if (value instanceof Long) return CONSTANT_Long; if (value instanceof Double) return CONSTANT_Double; throw new RuntimeException("bad literal value "+value); } static boolean isRefKind(byte refKind) { return (REF_getField <= refKind && refKind <= REF_invokeInterface); } public abstract static class LiteralEntry extends Entry { protected LiteralEntry(byte tag) { super(tag); } public abstract Comparable<?> literalValue(); } public static class NumberEntry extends LiteralEntry { final Number value; NumberEntry(Number value) { super(numberTagOf(value)); this.value = value; hashCode(); // force computation of valueHash } protected int computeValueHash() { return value.hashCode(); } public boolean equals(Object o) { return (o != null && o.getClass() == NumberEntry.class && ((NumberEntry) o).value.equals(value)); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { @SuppressWarnings("unchecked") Comparable<Number> compValue = (Comparable<Number>)value; x = compValue.compareTo(((NumberEntry)o).value); } return x; } public Number numberValue() { return value; } public Comparable<?> literalValue() { return (Comparable<?>) value; } public String stringValue() { return value.toString(); } } public static class StringEntry extends LiteralEntry { final Utf8Entry ref; public Entry getRef(int i) { return i == 0 ? ref : null; } StringEntry(Entry ref) { super(CONSTANT_String); this.ref = (Utf8Entry) ref; hashCode(); // force computation of valueHash } protected int computeValueHash() { return ref.hashCode() + tag; } public boolean equals(Object o) { return (o != null && o.getClass() == StringEntry.class && ((StringEntry)o).ref.eq(ref)); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { x = ref.compareTo(((StringEntry)o).ref); } return x; } public Comparable<?> literalValue() { return ref.stringValue(); } public String stringValue() { return ref.stringValue(); } } public static class ClassEntry extends Entry { final Utf8Entry ref; public Entry getRef(int i) { return i == 0 ? ref : null; } protected int computeValueHash() { return ref.hashCode() + tag; } ClassEntry(Entry ref) { super(CONSTANT_Class); this.ref = (Utf8Entry) ref; hashCode(); // force computation of valueHash } public boolean equals(Object o) { return (o != null && o.getClass() == ClassEntry.class && ((ClassEntry) o).ref.eq(ref)); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { x = ref.compareTo(((ClassEntry)o).ref); } return x; } public String stringValue() { return ref.stringValue(); } } public static class DescriptorEntry extends Entry { final Utf8Entry nameRef; final SignatureEntry typeRef; public Entry getRef(int i) { if (i == 0) return nameRef; if (i == 1) return typeRef; return null; } DescriptorEntry(Entry nameRef, Entry typeRef) { super(CONSTANT_NameandType); if (typeRef instanceof Utf8Entry) { typeRef = getSignatureEntry(typeRef.stringValue()); } this.nameRef = (Utf8Entry) nameRef; this.typeRef = (SignatureEntry) typeRef; hashCode(); // force computation of valueHash } protected int computeValueHash() { int hc2 = typeRef.hashCode(); return (nameRef.hashCode() + (hc2 << 8)) ^ hc2; } public boolean equals(Object o) { if (o == null || o.getClass() != DescriptorEntry.class) { return false; } DescriptorEntry that = (DescriptorEntry)o; return this.nameRef.eq(that.nameRef) && this.typeRef.eq(that.typeRef); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { DescriptorEntry that = (DescriptorEntry)o; // Primary key is typeRef, not nameRef. x = this.typeRef.compareTo(that.typeRef); if (x == 0) x = this.nameRef.compareTo(that.nameRef); } return x; } public String stringValue() { return stringValueOf(nameRef, typeRef); } static String stringValueOf(Entry nameRef, Entry typeRef) { return qualifiedStringValue(typeRef, nameRef); } public String prettyString() { return nameRef.stringValue()+typeRef.prettyString(); } public boolean isMethod() { return typeRef.isMethod(); } public byte getLiteralTag() { return typeRef.getLiteralTag(); } } static String qualifiedStringValue(Entry e1, Entry e2) { return qualifiedStringValue(e1.stringValue(), e2.stringValue()); } static String qualifiedStringValue(String s1, String s234) { // Qualification by dot must decompose uniquely. Second string might already be qualified. assert(s1.indexOf('.') < 0); return s1+"."+s234; } public static class MemberEntry extends Entry { final ClassEntry classRef; final DescriptorEntry descRef; public Entry getRef(int i) { if (i == 0) return classRef; if (i == 1) return descRef; return null; } protected int computeValueHash() { int hc2 = descRef.hashCode(); return (classRef.hashCode() + (hc2 << 8)) ^ hc2; } MemberEntry(byte tag, ClassEntry classRef, DescriptorEntry descRef) { super(tag); assert(isMemberTag(tag)); this.classRef = classRef; this.descRef = descRef; hashCode(); // force computation of valueHash } public boolean equals(Object o) { if (o == null || o.getClass() != MemberEntry.class) { return false; } MemberEntry that = (MemberEntry)o; return this.classRef.eq(that.classRef) && this.descRef.eq(that.descRef); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { MemberEntry that = (MemberEntry)o; if (Utils.SORT_MEMBERS_DESCR_MAJOR) // descRef is transmitted as UDELTA5; sort it first? x = this.descRef.compareTo(that.descRef); // Primary key is classRef. if (x == 0) x = this.classRef.compareTo(that.classRef); if (x == 0) x = this.descRef.compareTo(that.descRef); } return x; } public String stringValue() { return stringValueOf(tag, classRef, descRef); } static String stringValueOf(byte tag, ClassEntry classRef, DescriptorEntry descRef) { assert(isMemberTag(tag)); String pfx; switch (tag) { case CONSTANT_Fieldref: pfx = "Field:"; break; case CONSTANT_Methodref: pfx = "Method:"; break; case CONSTANT_InterfaceMethodref: pfx = "IMethod:"; break; default: pfx = tag+"???"; break; } return pfx+qualifiedStringValue(classRef, descRef); } public boolean isMethod() { return descRef.isMethod(); } } public static class SignatureEntry extends Entry { final Utf8Entry formRef; final ClassEntry[] classRefs; String value; Utf8Entry asUtf8Entry; public Entry getRef(int i) { if (i == 0) return formRef; return i-1 < classRefs.length ? classRefs[i-1] : null; } SignatureEntry(String value) { super(CONSTANT_Signature); value = value.intern(); // always do this this.value = value; String[] parts = structureSignature(value); formRef = getUtf8Entry(parts[0]); classRefs = new ClassEntry[parts.length-1]; for (int i = 1; i < parts.length; i++) { classRefs[i - 1] = getClassEntry(parts[i]); } hashCode(); // force computation of valueHash } protected int computeValueHash() { stringValue(); // force computation of value return value.hashCode() + tag; } public Utf8Entry asUtf8Entry() { if (asUtf8Entry == null) { asUtf8Entry = getUtf8Entry(stringValue()); } return asUtf8Entry; } public boolean equals(Object o) { return (o != null && o.getClass() == SignatureEntry.class && ((SignatureEntry)o).value.equals(value)); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { SignatureEntry that = (SignatureEntry)o; x = compareSignatures(this.value, that.value); } return x; } public String stringValue() { if (value == null) { value = stringValueOf(formRef, classRefs); } return value; } static String stringValueOf(Utf8Entry formRef, ClassEntry[] classRefs) { String[] parts = new String[1+classRefs.length]; parts[0] = formRef.stringValue(); for (int i = 1; i < parts.length; i++) { parts[i] = classRefs[i - 1].stringValue(); } return flattenSignature(parts).intern(); } public int computeSize(boolean countDoublesTwice) { String form = formRef.stringValue(); int min = 0; int max = 1; if (isMethod()) { min = 1; max = form.indexOf(')'); } int size = 0; for (int i = min; i < max; i++) { switch (form.charAt(i)) { case 'D': case 'J': if (countDoublesTwice) { size++; } break; case '[': // Skip rest of array info. while (form.charAt(i) == '[') { ++i; } break; case ';': continue; default: assert (0 <= JAVA_SIGNATURE_CHARS.indexOf(form.charAt(i))); break; } size++; } return size; } public boolean isMethod() { return formRef.stringValue().charAt(0) == '('; } public byte getLiteralTag() { switch (formRef.stringValue().charAt(0)) { case 'I': return CONSTANT_Integer; case 'J': return CONSTANT_Long; case 'F': return CONSTANT_Float; case 'D': return CONSTANT_Double; case 'B': case 'S': case 'C': case 'Z': return CONSTANT_Integer; case 'L': /* switch (classRefs[0].stringValue()) { case "java/lang/String": return CONSTANT_String; case "java/lang/invoke/MethodHandle": return CONSTANT_MethodHandle; case "java/lang/invoke/MethodType": return CONSTANT_MethodType; default: // java/lang/Object, etc. return CONSTANT_LoadableValue; } */ return CONSTANT_String; // JDK 7 ConstantValue limited to String } assert(false); return CONSTANT_None; } public String prettyString() { String s; if (isMethod()) { s = formRef.stringValue(); s = s.substring(0, 1+s.indexOf(')')); } else { s = "/" + formRef.stringValue(); } int i; while ((i = s.indexOf(';')) >= 0) { s = s.substring(0, i) + s.substring(i + 1); } return s; } } static int compareSignatures(String s1, String s2) { return compareSignatures(s1, s2, null, null); } static int compareSignatures(String s1, String s2, String[] p1, String[] p2) { final int S1_COMES_FIRST = -1; final int S2_COMES_FIRST = +1; char c1 = s1.charAt(0); char c2 = s2.charAt(0); // fields before methods (because there are fewer of them) if (c1 != '(' && c2 == '(') return S1_COMES_FIRST; if (c2 != '(' && c1 == '(') return S2_COMES_FIRST; if (p1 == null) p1 = structureSignature(s1); if (p2 == null) p2 = structureSignature(s2); /* // non-classes before classes (because there are fewer of them) if (p1.length == 1 && p2.length > 1) return S1_COMES_FIRST; if (p2.length == 1 && p1.length > 1) return S2_COMES_FIRST; // all else being equal, use the same comparison as for Utf8 strings return s1.compareTo(s2); */ if (p1.length != p2.length) return p1.length - p2.length; int length = p1.length; for (int i = length; --i >= 0; ) { int res = p1[i].compareTo(p2[i]); if (res != 0) return res; } assert(s1.equals(s2)); return 0; } static int countClassParts(Utf8Entry formRef) { int num = 0; String s = formRef.stringValue(); for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == 'L') ++num; } return num; } static String flattenSignature(String[] parts) { String form = parts[0]; if (parts.length == 1) return form; int len = form.length(); for (int i = 1; i < parts.length; i++) { len += parts[i].length(); } char[] sig = new char[len]; int j = 0; int k = 1; for (int i = 0; i < form.length(); i++) { char ch = form.charAt(i); sig[j++] = ch; if (ch == 'L') { String cls = parts[k++]; cls.getChars(0, cls.length(), sig, j); j += cls.length(); //sig[j++] = ';'; } } assert(j == len); assert(k == parts.length); return new String(sig); } private static int skipTo(char semi, String sig, int i) { i = sig.indexOf(semi, i); return (i >= 0) ? i : sig.length(); } static String[] structureSignature(String sig) { int firstl = sig.indexOf('L'); if (firstl < 0) { String[] parts = { sig }; return parts; } // Segment the string like sig.split("L\\([^;<]*\\)"). // N.B.: Previous version of this code did a more complex match, // to next ch < ' ' or ch in [';'..'@']. The only important // characters are ';' and '<', since they are part of the // signature syntax. // Examples: // "(Ljava/lang/Object;IJLLoo;)V" => {"(L;IJL;)V", "java/lang/Object", "Loo"} // "Ljava/util/List<Ljava/lang/String;>;" => {"L<L;>;", "java/util/List", "java/lang/String"} char[] form = null; String[] parts = null; for (int pass = 0; pass <= 1; pass++) { // pass 0 is a sizing pass, pass 1 packs the arrays int formPtr = 0; int partPtr = 1; int nextsemi = 0, nextangl = 0; // next ';' or '<', or zero, or sigLen int lastj = 0; for (int i = firstl + 1, j; i > 0; i = sig.indexOf('L', j) + 1) { // sig[i-1] is 'L', while sig[j] will be the first ';' or '<' after it // each part is in sig[i .. j-1] if (nextsemi < i) nextsemi = skipTo(';', sig, i); if (nextangl < i) nextangl = skipTo('<', sig, i); j = (nextsemi < nextangl ? nextsemi : nextangl); if (pass != 0) { sig.getChars(lastj, i, form, formPtr); parts[partPtr] = sig.substring(i, j); } formPtr += (i - lastj); partPtr += 1; lastj = j; } if (pass != 0) { sig.getChars(lastj, sig.length(), form, formPtr); break; } formPtr += (sig.length() - lastj); form = new char[formPtr]; parts = new String[partPtr]; } parts[0] = new String(form); //assert(flattenSignature(parts).equals(sig)); return parts; } /** @since 1.7, JSR 292 */ public static class MethodHandleEntry extends Entry { final int refKind; final MemberEntry memRef; public Entry getRef(int i) { return i == 0 ? memRef : null; } protected int computeValueHash() { int hc2 = refKind; return (memRef.hashCode() + (hc2 << 8)) ^ hc2; } MethodHandleEntry(byte refKind, MemberEntry memRef) { super(CONSTANT_MethodHandle); assert(isRefKind(refKind)); this.refKind = refKind; this.memRef = memRef; hashCode(); // force computation of valueHash } public boolean equals(Object o) { if (o == null || o.getClass() != MethodHandleEntry.class) { return false; } MethodHandleEntry that = (MethodHandleEntry)o; return this.refKind == that.refKind && this.memRef.eq(that.memRef); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { MethodHandleEntry that = (MethodHandleEntry)o; if (Utils.SORT_HANDLES_KIND_MAJOR) // Primary key could be refKind. x = this.refKind - that.refKind; // Primary key is memRef, which is transmitted as UDELTA5. if (x == 0) x = this.memRef.compareTo(that.memRef); if (x == 0) x = this.refKind - that.refKind; } return x; } public static String stringValueOf(int refKind, MemberEntry memRef) { return refKindName(refKind)+":"+memRef.stringValue(); } public String stringValue() { return stringValueOf(refKind, memRef); } } /** @since 1.7, JSR 292 */ public static class MethodTypeEntry extends Entry { final SignatureEntry typeRef; public Entry getRef(int i) { return i == 0 ? typeRef : null; } protected int computeValueHash() { return typeRef.hashCode() + tag; } MethodTypeEntry(SignatureEntry typeRef) { super(CONSTANT_MethodType); this.typeRef = typeRef; hashCode(); // force computation of valueHash } public boolean equals(Object o) { if (o == null || o.getClass() != MethodTypeEntry.class) { return false; } MethodTypeEntry that = (MethodTypeEntry)o; return this.typeRef.eq(that.typeRef); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { MethodTypeEntry that = (MethodTypeEntry)o; x = this.typeRef.compareTo(that.typeRef); } return x; } public String stringValue() { return typeRef.stringValue(); } } /** @since 1.7, JSR 292 */ public static class InvokeDynamicEntry extends Entry { final BootstrapMethodEntry bssRef; final DescriptorEntry descRef; public Entry getRef(int i) { if (i == 0) return bssRef; if (i == 1) return descRef; return null; } protected int computeValueHash() { int hc2 = descRef.hashCode(); return (bssRef.hashCode() + (hc2 << 8)) ^ hc2; } InvokeDynamicEntry(BootstrapMethodEntry bssRef, DescriptorEntry descRef) { super(CONSTANT_InvokeDynamic); this.bssRef = bssRef; this.descRef = descRef; hashCode(); // force computation of valueHash } public boolean equals(Object o) { if (o == null || o.getClass() != InvokeDynamicEntry.class) { return false; } InvokeDynamicEntry that = (InvokeDynamicEntry)o; return this.bssRef.eq(that.bssRef) && this.descRef.eq(that.descRef); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { InvokeDynamicEntry that = (InvokeDynamicEntry)o; if (Utils.SORT_INDY_BSS_MAJOR) // Primary key could be bsmRef. x = this.bssRef.compareTo(that.bssRef); // Primary key is descriptor, which is transmitted as UDELTA5. if (x == 0) x = this.descRef.compareTo(that.descRef); if (x == 0) x = this.bssRef.compareTo(that.bssRef); } return x; } public String stringValue() { return stringValueOf(bssRef, descRef); } static String stringValueOf(BootstrapMethodEntry bssRef, DescriptorEntry descRef) { return "Indy:"+bssRef.stringValue()+"."+descRef.stringValue(); } } /** @since 1.7, JSR 292 */ public static class BootstrapMethodEntry extends Entry { final MethodHandleEntry bsmRef; final Entry[] argRefs; public Entry getRef(int i) { if (i == 0) return bsmRef; if (i-1 < argRefs.length) return argRefs[i-1]; return null; } protected int computeValueHash() { int hc2 = bsmRef.hashCode(); return (Arrays.hashCode(argRefs) + (hc2 << 8)) ^ hc2; } BootstrapMethodEntry(MethodHandleEntry bsmRef, Entry[] argRefs) { super(CONSTANT_BootstrapMethod); this.bsmRef = bsmRef; this.argRefs = argRefs.clone(); hashCode(); // force computation of valueHash } public boolean equals(Object o) { if (o == null || o.getClass() != BootstrapMethodEntry.class) { return false; } BootstrapMethodEntry that = (BootstrapMethodEntry)o; return this.bsmRef.eq(that.bsmRef) && Arrays.equals(this.argRefs, that.argRefs); } public int compareTo(Object o) { int x = superCompareTo(o); if (x == 0) { BootstrapMethodEntry that = (BootstrapMethodEntry)o; if (Utils.SORT_BSS_BSM_MAJOR) // Primary key is bsmRef. x = this.bsmRef.compareTo(that.bsmRef); // Primary key is args array length, which is transmitted as UDELTA5. if (x == 0) x = compareArgArrays(this.argRefs, that.argRefs); if (x == 0) x = this.bsmRef.compareTo(that.bsmRef); } return x; } public String stringValue() { return stringValueOf(bsmRef, argRefs); } static String stringValueOf(MethodHandleEntry bsmRef, Entry[] argRefs) { StringBuilder sb = new StringBuilder(bsmRef.stringValue()); // Arguments are formatted as "<foo;bar;baz>" instead of "[foo,bar,baz]". // This ensures there will be no confusion if "[,]" appear inside of names. char nextSep = '<'; boolean didOne = false; for (Entry argRef : argRefs) { sb.append(nextSep).append(argRef.stringValue()); nextSep = ';'; } if (nextSep == '<') sb.append(nextSep); sb.append('>'); return sb.toString(); } static int compareArgArrays(Entry[] a1, Entry[] a2) { int x = a1.length - a2.length; if (x != 0) return x; for (int i = 0; i < a1.length; i++) { x = a1[i].compareTo(a2[i]); if (x != 0) break; } return x; } } // Handy constants: protected static final Entry[] noRefs = {}; protected static final ClassEntry[] noClassRefs = {}; /** An Index is a mapping between CP entries and small integers. */ public static final class Index extends AbstractList<Entry> { protected String debugName; protected Entry[] cpMap; protected boolean flattenSigs; protected Entry[] getMap() { return cpMap; } protected Index(String debugName) { this.debugName = debugName; } protected Index(String debugName, Entry[] cpMap) { this(debugName); setMap(cpMap); } protected void setMap(Entry[] cpMap) { clearIndex(); this.cpMap = cpMap; } protected Index(String debugName, Collection<Entry> cpMapList) { this(debugName); setMap(cpMapList); } protected void setMap(Collection<Entry> cpMapList) { cpMap = new Entry[cpMapList.size()]; cpMapList.toArray(cpMap); setMap(cpMap); } public int size() { return cpMap.length; } public Entry get(int i) { return cpMap[i]; } public Entry getEntry(int i) { // same as get(), with covariant return type return cpMap[i]; } // Find index of e in cpMap, or return -1 if none. // // As a special hack, if flattenSigs, signatures are // treated as equivalent entries of cpMap. This is wrong // from a Collection point of view, because contains() // reports true for signatures, but the iterator() // never produces them! private int findIndexOf(Entry e) { if (indexKey == null) { initializeIndex(); } int probe = findIndexLocation(e); if (indexKey[probe] != e) { if (flattenSigs && e.tag == CONSTANT_Signature) { SignatureEntry se = (SignatureEntry) e; return findIndexOf(se.asUtf8Entry()); } return -1; } int index = indexValue[probe]; assert(e.equals(cpMap[index])); return index; } public boolean contains(Entry e) { return findIndexOf(e) >= 0; } // Find index of e in cpMap. Should not return -1. public int indexOf(Entry e) { int index = findIndexOf(e); if (index < 0 && verbose() > 0) { System.out.println("not found: "+e); System.out.println(" in: "+this.dumpString()); Thread.dumpStack(); } assert(index >= 0); return index; } public int lastIndexOf(Entry e) { return indexOf(e); } public boolean assertIsSorted() { for (int i = 1; i < cpMap.length; i++) { if (cpMap[i-1].compareTo(cpMap[i]) > 0) { System.out.println("Not sorted at "+(i-1)+"/"+i+": "+this.dumpString()); return false; } } return true; } // internal hash table protected Entry[] indexKey; protected int[] indexValue; protected void clearIndex() { indexKey = null; indexValue = null; } private int findIndexLocation(Entry e) { int size = indexKey.length; int hash = e.hashCode(); int probe = hash & (size - 1); int stride = ((hash >>> 8) | 1) & (size - 1); for (;;) { Entry e1 = indexKey[probe]; if (e1 == e || e1 == null) return probe; probe += stride; if (probe >= size) probe -= size; } } private void initializeIndex() { if (verbose() > 2) System.out.println("initialize Index "+debugName+" ["+size()+"]"); int hsize0 = (int)((cpMap.length + 10) * 1.5); int hsize = 1; while (hsize < hsize0) { hsize <<= 1; } indexKey = new Entry[hsize]; indexValue = new int[hsize]; for (int i = 0; i < cpMap.length; i++) { Entry e = cpMap[i]; if (e == null) continue; int probe = findIndexLocation(e); assert(indexKey[probe] == null); // e has unique index indexKey[probe] = e; indexValue[probe] = i; } } public Entry[] toArray(Entry[] a) { int sz = size(); if (a.length < sz) return super.toArray(a); System.arraycopy(cpMap, 0, a, 0, sz); if (a.length > sz) a[sz] = null; return a; } public Entry[] toArray() { return toArray(new Entry[size()]); } public Object clone() { return new Index(debugName, cpMap.clone()); } public String toString() { return "Index "+debugName+" ["+size()+"]"; } public String dumpString() { String s = toString(); s += " {\n"; for (int i = 0; i < cpMap.length; i++) { s += " "+i+": "+cpMap[i]+"\n"; } s += "}"; return s; } } // Index methods. public static Index makeIndex(String debugName, Entry[] cpMap) { return new Index(debugName, cpMap); } public static Index makeIndex(String debugName, Collection<Entry> cpMapList) { return new Index(debugName, cpMapList); } /** Sort this index (destructively) into canonical order. */ public static void sort(Index ix) { // %%% Should move this into class Index. ix.clearIndex(); Arrays.sort(ix.cpMap); if (verbose() > 2) System.out.println("sorted "+ix.dumpString()); } /** Return a set of indexes partitioning these entries. * The keys array must of length this.size(), and marks entries. * The result array is as long as one plus the largest key value. * Entries with a negative key are dropped from the partition. */ public static Index[] partition(Index ix, int[] keys) { // %%% Should move this into class Index. List<List<Entry>> parts = new ArrayList<>(); Entry[] cpMap = ix.cpMap; assert(keys.length == cpMap.length); for (int i = 0; i < keys.length; i++) { int key = keys[i]; if (key < 0) continue; while (key >= parts.size()) { parts.add(null); } List<Entry> part = parts.get(key); if (part == null) { parts.set(key, part = new ArrayList<>()); } part.add(cpMap[i]); } Index[] indexes = new Index[parts.size()]; for (int key = 0; key < indexes.length; key++) { List<Entry> part = parts.get(key); if (part == null) continue; indexes[key] = new Index(ix.debugName+"/part#"+key, part); assert(indexes[key].indexOf(part.get(0)) == 0); } return indexes; } public static Index[] partitionByTag(Index ix) { // Partition by tag. Entry[] cpMap = ix.cpMap; int[] keys = new int[cpMap.length]; for (int i = 0; i < keys.length; i++) { Entry e = cpMap[i]; keys[i] = (e == null)? -1: e.tag; } Index[] byTag = partition(ix, keys); for (int tag = 0; tag < byTag.length; tag++) { if (byTag[tag] == null) continue; byTag[tag].debugName = tagName(tag); } if (byTag.length < CONSTANT_Limit) { Index[] longer = new Index[CONSTANT_Limit]; System.arraycopy(byTag, 0, longer, 0, byTag.length); byTag = longer; } return byTag; } /** Coherent group of constant pool indexes. */ public static class IndexGroup { private Index[] indexByTag = new Index[CONSTANT_Limit]; private Index[] indexByTagGroup; private int[] untypedFirstIndexByTag; private int totalSizeQQ; private Index[][] indexByTagAndClass; /** Index of all CP entries of all types, in definition order. */ private Index makeTagGroupIndex(byte tagGroupTag, byte[] tagsInGroup) { if (indexByTagGroup == null) indexByTagGroup = new Index[CONSTANT_GroupLimit - CONSTANT_GroupFirst]; int which = tagGroupTag - CONSTANT_GroupFirst; assert(indexByTagGroup[which] == null); int fillp = 0; Entry[] cpMap = null; for (int pass = 1; pass <= 2; pass++) { untypedIndexOf(null); // warm up untypedFirstIndexByTag for (byte tag : tagsInGroup) { Index ix = indexByTag[tag]; if (ix == null) continue; int ixLen = ix.cpMap.length; if (ixLen == 0) continue; assert(tagGroupTag == CONSTANT_All ? fillp == untypedFirstIndexByTag[tag] : fillp < untypedFirstIndexByTag[tag]); if (cpMap != null) { assert(cpMap[fillp] == null); assert(cpMap[fillp+ixLen-1] == null); System.arraycopy(ix.cpMap, 0, cpMap, fillp, ixLen); } fillp += ixLen; } if (cpMap == null) { assert(pass == 1); // get ready for pass 2 cpMap = new Entry[fillp]; fillp = 0; } } indexByTagGroup[which] = new Index(tagName(tagGroupTag), cpMap); return indexByTagGroup[which]; } public int untypedIndexOf(Entry e) { if (untypedFirstIndexByTag == null) { untypedFirstIndexByTag = new int[CONSTANT_Limit+1]; int fillp = 0; for (int i = 0; i < TAGS_IN_ORDER.length; i++) { byte tag = TAGS_IN_ORDER[i]; Index ix = indexByTag[tag]; if (ix == null) continue; int ixLen = ix.cpMap.length; untypedFirstIndexByTag[tag] = fillp; fillp += ixLen; } untypedFirstIndexByTag[CONSTANT_Limit] = fillp; } if (e == null) return -1; int tag = e.tag; Index ix = indexByTag[tag]; if (ix == null) return -1; int idx = ix.findIndexOf(e); if (idx >= 0) idx += untypedFirstIndexByTag[tag]; return idx; } public void initIndexByTag(byte tag, Index ix) { assert(indexByTag[tag] == null); // do not init twice Entry[] cpMap = ix.cpMap; for (int i = 0; i < cpMap.length; i++) { // It must be a homogeneous Entry set. assert(cpMap[i].tag == tag); } if (tag == CONSTANT_Utf8) { // Special case: First Utf8 must always be empty string. assert(cpMap.length == 0 || cpMap[0].stringValue().equals("")); } indexByTag[tag] = ix; // decache indexes derived from this one: untypedFirstIndexByTag = null; indexByTagGroup = null; if (indexByTagAndClass != null) indexByTagAndClass[tag] = null; } /** Index of all CP entries of a given tag. */ public Index getIndexByTag(byte tag) { if (tag >= CONSTANT_GroupFirst) return getIndexByTagGroup(tag); Index ix = indexByTag[tag]; if (ix == null) { // Make an empty one by default. ix = new Index(tagName(tag), new Entry[0]); indexByTag[tag] = ix; } return ix; } private Index getIndexByTagGroup(byte tag) { // pool groups: if (indexByTagGroup != null) { Index ix = indexByTagGroup[tag - CONSTANT_GroupFirst]; if (ix != null) return ix; } switch (tag) { case CONSTANT_All: return makeTagGroupIndex(CONSTANT_All, TAGS_IN_ORDER); case CONSTANT_LoadableValue: return makeTagGroupIndex(CONSTANT_LoadableValue, LOADABLE_VALUE_TAGS); case CONSTANT_AnyMember: return makeTagGroupIndex(CONSTANT_AnyMember, ANY_MEMBER_TAGS); case CONSTANT_FieldSpecific: // This one does not have any fixed index, since it is context-specific. return null; } throw new AssertionError("bad tag group "+tag); } /** Index of all CP entries of a given tag and class. */ public Index getMemberIndex(byte tag, ClassEntry classRef) { if (classRef == null) throw new RuntimeException("missing class reference for " + tagName(tag)); if (indexByTagAndClass == null) indexByTagAndClass = new Index[CONSTANT_Limit][]; Index allClasses = getIndexByTag(CONSTANT_Class); Index[] perClassIndexes = indexByTagAndClass[tag]; if (perClassIndexes == null) { // Create the partition now. // Divide up all entries of the given tag according to their class. Index allMembers = getIndexByTag(tag); int[] whichClasses = new int[allMembers.size()]; for (int i = 0; i < whichClasses.length; i++) { MemberEntry e = (MemberEntry) allMembers.get(i); int whichClass = allClasses.indexOf(e.classRef); whichClasses[i] = whichClass; } perClassIndexes = partition(allMembers, whichClasses); for (int i = 0; i < perClassIndexes.length; i++) { assert (perClassIndexes[i] == null || perClassIndexes[i].assertIsSorted()); } indexByTagAndClass[tag] = perClassIndexes; } int whichClass = allClasses.indexOf(classRef); return perClassIndexes[whichClass]; } // Given the sequence of all methods of the given name and class, // produce the ordinal of this particular given overloading. public int getOverloadingIndex(MemberEntry methodRef) { Index ix = getMemberIndex(methodRef.tag, methodRef.classRef); Utf8Entry nameRef = methodRef.descRef.nameRef; int ord = 0; for (int i = 0; i < ix.cpMap.length; i++) { MemberEntry e = (MemberEntry) ix.cpMap[i]; if (e.equals(methodRef)) return ord; if (e.descRef.nameRef.equals(nameRef)) // Found a different overloading. Increment the ordinal. ord++; } throw new RuntimeException("should not reach here"); } // Inverse of getOverloadingIndex public MemberEntry getOverloadingForIndex(byte tag, ClassEntry classRef, String name, int which) { assert(name.equals(name.intern())); Index ix = getMemberIndex(tag, classRef); int ord = 0; for (int i = 0; i < ix.cpMap.length; i++) { MemberEntry e = (MemberEntry) ix.cpMap[i]; if (e.descRef.nameRef.stringValue().equals(name)) { if (ord == which) return e; ord++; } } throw new RuntimeException("should not reach here"); } public boolean haveNumbers() { for (byte tag : NUMBER_TAGS) { if (getIndexByTag(tag).size() > 0) return true; } return false; } public boolean haveExtraTags() { for (byte tag : EXTRA_TAGS) { if (getIndexByTag(tag).size() > 0) return true; } return false; } } /** Close the set cpRefs under the getRef(*) relation. * Also, if flattenSigs, replace all signatures in cpRefs * by their equivalent Utf8s. * Also, discard null from cpRefs. */ public static void completeReferencesIn(Set<Entry> cpRefs, boolean flattenSigs) { completeReferencesIn(cpRefs, flattenSigs, null); } public static void completeReferencesIn(Set<Entry> cpRefs, boolean flattenSigs, List<BootstrapMethodEntry>bsms) { cpRefs.remove(null); for (ListIterator<Entry> work = new ArrayList<>(cpRefs).listIterator(cpRefs.size()); work.hasPrevious(); ) { Entry e = work.previous(); work.remove(); // pop stack assert(e != null); if (flattenSigs && e.tag == CONSTANT_Signature) { SignatureEntry se = (SignatureEntry) e; Utf8Entry ue = se.asUtf8Entry(); // Totally replace e by se. cpRefs.remove(se); cpRefs.add(ue); e = ue; // do not descend into the sig } if (bsms != null && e.tag == CONSTANT_BootstrapMethod) { BootstrapMethodEntry bsm = (BootstrapMethodEntry)e; cpRefs.remove(bsm); // move it away to the side table where it belongs if (!bsms.contains(bsm)) bsms.add(bsm); // fall through to recursively add refs for this entry } // Recursively add the refs of e to cpRefs: for (int i = 0; ; i++) { Entry re = e.getRef(i); if (re == null) break; // no more refs in e if (cpRefs.add(re)) // output the ref work.add(re); // push stack, if a new ref } } } static double percent(int num, int den) { return (int)((10000.0*num)/den + 0.5) / 100.0; } public static String tagName(int tag) { switch (tag) { case CONSTANT_Utf8: return "Utf8"; case CONSTANT_Integer: return "Integer"; case CONSTANT_Float: return "Float"; case CONSTANT_Long: return "Long"; case CONSTANT_Double: return "Double"; case CONSTANT_Class: return "Class"; case CONSTANT_String: return "String"; case CONSTANT_Fieldref: return "Fieldref"; case CONSTANT_Methodref: return "Methodref"; case CONSTANT_InterfaceMethodref: return "InterfaceMethodref"; case CONSTANT_NameandType: return "NameandType"; case CONSTANT_MethodHandle: return "MethodHandle"; case CONSTANT_MethodType: return "MethodType"; case CONSTANT_InvokeDynamic: return "InvokeDynamic"; // pseudo-tags: case CONSTANT_All: return "**All"; case CONSTANT_None: return "**None"; case CONSTANT_LoadableValue: return "**LoadableValue"; case CONSTANT_AnyMember: return "**AnyMember"; case CONSTANT_FieldSpecific: return "*FieldSpecific"; case CONSTANT_Signature: return "*Signature"; case CONSTANT_BootstrapMethod: return "*BootstrapMethod"; } return "tag#"+tag; } public static String refKindName(int refKind) { switch (refKind) { case REF_getField: return "getField"; case REF_getStatic: return "getStatic"; case REF_putField: return "putField"; case REF_putStatic: return "putStatic"; case REF_invokeVirtual: return "invokeVirtual"; case REF_invokeStatic: return "invokeStatic"; case REF_invokeSpecial: return "invokeSpecial"; case REF_newInvokeSpecial: return "newInvokeSpecial"; case REF_invokeInterface: return "invokeInterface"; } return "refKind#"+refKind; } // archive constant pool definition order static final byte TAGS_IN_ORDER[] = { CONSTANT_Utf8, CONSTANT_Integer, // cp_Int CONSTANT_Float, CONSTANT_Long, CONSTANT_Double, CONSTANT_String, // note that String=8 precedes Class=7 CONSTANT_Class, CONSTANT_Signature, CONSTANT_NameandType, // cp_Descr CONSTANT_Fieldref, // cp_Field CONSTANT_Methodref, // cp_Method CONSTANT_InterfaceMethodref, // cp_Imethod // Constants defined in JDK 7 and later: CONSTANT_MethodHandle, CONSTANT_MethodType, CONSTANT_BootstrapMethod, // pseudo-tag, really stored in a class attribute CONSTANT_InvokeDynamic }; static final byte TAG_ORDER[]; static { TAG_ORDER = new byte[CONSTANT_Limit]; for (int i = 0; i < TAGS_IN_ORDER.length; i++) { TAG_ORDER[TAGS_IN_ORDER[i]] = (byte)(i+1); } /* System.out.println("TAG_ORDER[] = {"); for (int i = 0; i < TAG_ORDER.length; i++) System.out.println(" "+TAG_ORDER[i]+","); System.out.println("};"); */ } static final byte[] NUMBER_TAGS = { CONSTANT_Integer, CONSTANT_Float, CONSTANT_Long, CONSTANT_Double }; static final byte[] EXTRA_TAGS = { CONSTANT_MethodHandle, CONSTANT_MethodType, CONSTANT_BootstrapMethod, // pseudo-tag CONSTANT_InvokeDynamic }; static final byte[] LOADABLE_VALUE_TAGS = { // for CONSTANT_LoadableValue CONSTANT_Integer, CONSTANT_Float, CONSTANT_Long, CONSTANT_Double, CONSTANT_String, CONSTANT_Class, CONSTANT_MethodHandle, CONSTANT_MethodType }; static final byte[] ANY_MEMBER_TAGS = { // for CONSTANT_AnyMember CONSTANT_Fieldref, CONSTANT_Methodref, CONSTANT_InterfaceMethodref }; static final byte[] FIELD_SPECIFIC_TAGS = { // for CONSTANT_FieldSpecific CONSTANT_Integer, CONSTANT_Float, CONSTANT_Long, CONSTANT_Double, CONSTANT_String }; static { assert( verifyTagOrder(TAGS_IN_ORDER) && verifyTagOrder(NUMBER_TAGS) && verifyTagOrder(EXTRA_TAGS) && verifyTagOrder(LOADABLE_VALUE_TAGS) && verifyTagOrder(ANY_MEMBER_TAGS) && verifyTagOrder(FIELD_SPECIFIC_TAGS) ); } private static boolean verifyTagOrder(byte[] tags) { int prev = -1; for (byte tag : tags) { int next = TAG_ORDER[tag]; assert(next > 0) : "tag not found: "+tag; assert(TAGS_IN_ORDER[next-1] == tag) : "tag repeated: "+tag+" => "+next+" => "+TAGS_IN_ORDER[next-1]; assert(prev < next) : "tags not in order: "+Arrays.toString(tags)+" at "+tag; prev = next; } return true; } }
36.893309
116
0.520897
09e223dcbe7d450d114770773611a8fca352b396
559
package br.com.sanchez.backend.java.repository; import br.com.sanchez.backend.java.model.Shop; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.Date; import java.util.List; @Repository public interface ShopRepository extends JpaRepository<Shop, Long>, ReportRepository { public List<Shop> findAllByUserIdentifier(final String userIdentifier); public List<Shop> findAllByTotalGreaterThan(final Float total); List<Shop> findAllByDateGreaterThan(final Date date); }
32.882353
85
0.815742
fedb7cd21b226a696316127b6f8b60f36a171738
173
package com.github.jenya705.mcapi.inventory; /** * @author Jenya705 */ public interface IdentifiedInventoryItemStack extends InventoryItemStack { String getId(); }
15.727273
74
0.757225
29559ef19ffb2f04c1f2c842f45c37feb8958aae
769
package com.mashibing; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class HiveJdbcClient { private static String driverName = "org.apache.hive.jdbc.HiveDriver"; public static void main(String[] args) throws SQLException { try { Class.forName(driverName); } catch (ClassNotFoundException e) { e.printStackTrace(); } Connection conn = DriverManager.getConnection("jdbc:hive2://node04:10000/default", "root", ""); Statement stmt = conn.createStatement(); String sql = "select * from psn limit 5"; ResultSet res = stmt.executeQuery(sql); while (res.next()) { System.out.println(res.getString(1) + "-" + res.getString("name")); } } }
26.517241
97
0.720416
394da3aa06a7abb8b9f09f6629ad63dd23712d86
626
package academy.devdojo.maratonajava.javacore.Bintroducaometodos.dominio; public class Pessoa { private String nome; private int idade; public void setNome(String nome) { this.nome = nome; } public String getNome() { return nome; } public void setIdade(int idade) { if(idade < 0){ System.out.println("idade inválida"); return; } this.idade = idade; } public int getIdade() { return idade; } public void imprime() { System.out.println(this.nome); System.out.println(this.idade); } }
18.411765
73
0.57508
cbeebc952f88991d5c367dc84128d350712e048a
4,953
/* * MIT License * * Copyright (c) 2017-2019 nuls.io * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ package io.nuls.contract.entity.tx.validator; import io.nuls.contract.constant.ContractErrorCode; import io.nuls.contract.entity.tx.DeleteContractTransaction; import io.nuls.contract.entity.txdata.DeleteContractData; import io.nuls.contract.ledger.module.ContractBalance; import io.nuls.contract.ledger.service.ContractUtxoService; import io.nuls.contract.storage.po.ContractAddressInfoPo; import io.nuls.contract.storage.service.ContractAddressStorageService; import io.nuls.core.tools.array.ArraysTool; import io.nuls.core.tools.log.Log; import io.nuls.kernel.constant.TransactionErrorCode; import io.nuls.kernel.exception.NulsException; import io.nuls.kernel.lite.annotation.Autowired; import io.nuls.kernel.lite.annotation.Component; import io.nuls.kernel.model.Na; import io.nuls.kernel.model.Result; import io.nuls.kernel.script.SignatureUtil; import io.nuls.kernel.utils.AddressTool; import io.nuls.kernel.validate.NulsDataValidator; import io.nuls.kernel.validate.ValidateResult; import java.util.Set; /** * @author: PierreLuo * @date: 2018/10/2 */ @Component public class DeleteContractTxValidator implements NulsDataValidator<DeleteContractTransaction> { @Autowired private ContractAddressStorageService contractAddressStorageService; @Autowired private ContractUtxoService contractUtxoService; @Override public ValidateResult validate(DeleteContractTransaction tx) throws NulsException { DeleteContractData txData = tx.getTxData(); byte[] sender = txData.getSender(); byte[] contractAddressBytes = txData.getContractAddress(); Set<String> addressSet = SignatureUtil.getAddressFromTX(tx); if (!addressSet.contains(AddressTool.getStringAddressByBytes(sender))) { Log.error("contract delete error: The contract deleter is not the transaction creator."); return ValidateResult.getFailedResult(this.getClass().getSimpleName(), TransactionErrorCode.TX_DATA_VALIDATION_ERROR); } Result<ContractAddressInfoPo> contractAddressInfoPoResult = contractAddressStorageService.getContractAddressInfo(contractAddressBytes); if(contractAddressInfoPoResult.isFailed()) { return ValidateResult.getFailedResult(this.getClass().getSimpleName(), contractAddressInfoPoResult.getErrorCode()); } ContractAddressInfoPo contractAddressInfoPo = contractAddressInfoPoResult.getData(); if(contractAddressInfoPo == null) { Log.error("contract delete error: The contract does not exist."); return ValidateResult.getFailedResult(this.getClass().getSimpleName(), ContractErrorCode.CONTRACT_ADDRESS_NOT_EXIST); } if(!ArraysTool.arrayEquals(sender, contractAddressInfoPo.getSender())) { Log.error("contract delete error: The contract deleter is not the contract creator."); return ValidateResult.getFailedResult(this.getClass().getSimpleName(), TransactionErrorCode.TX_DATA_VALIDATION_ERROR); } Result<ContractBalance> result = contractUtxoService.getBalance(contractAddressBytes); ContractBalance balance = (ContractBalance) result.getData(); if(balance == null) { Log.error("contract delete error: That balance of the contract is abnormal."); return ValidateResult.getFailedResult(this.getClass().getSimpleName(), TransactionErrorCode.TX_DATA_VALIDATION_ERROR); } Na totalBalance = balance.getBalance(); if(totalBalance.compareTo(Na.ZERO) != 0) { Log.error("contract delete error: The balance of the contract is not 0."); return ValidateResult.getFailedResult(this.getClass().getSimpleName(), ContractErrorCode.CONTRACT_DELETE_BALANCE); } return ValidateResult.getSuccessResult(); } }
46.28972
143
0.756107
3a3ed41fd04e407369841df1caa2f6f3e448a918
523
public class Test{ public static void main(String[] args) { int[] a={39,48,57,62,40,51,43,50}; int[] b={9,36,17,5,28,30,24,19}; System.err.println("结果为:"); for (int i = 0; i < a.length; i++) { for (int j = 0; j < b.length; j++) { int sum = a[i] + b[j]; int differ = a[i] - b[j]; System.err.println(a[i] +"+"+ b[j]+"="+sum +"\t\t\t"+a[i] +"-"+ b[j]+"="+differ); } System.err.println(); } } }
32.6875
97
0.403442
bc75790a31bebd511ea16044a868513dc6b5c7d6
387
package dev.codesoapbox.backity.core.logs.application.messages; import dev.codesoapbox.backity.core.shared.infrastructure.config.openapi.IncludeInOpenApiDocs; import lombok.Value; import javax.validation.constraints.NotNull; @IncludeInOpenApiDocs @Value(staticConstructor = "of") public class LogCreatedMessage { @NotNull String message; @NotNull Integer maxLogs; }
21.5
94
0.795866
a36714a48440743c173145efbef99663e654f560
9,980
package com.googlecode.totallylazy; import com.googlecode.totallylazy.annotations.multimethod; import com.googlecode.totallylazy.annotations.tailrec; import com.googlecode.totallylazy.functions.*; import com.googlecode.totallylazy.comparators.Maximum; import com.googlecode.totallylazy.comparators.Minimum; import com.googlecode.totallylazy.predicates.*; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.Reader; import java.nio.charset.Charset; import static com.googlecode.totallylazy.Closeables.using; import static com.googlecode.totallylazy.LazyException.lazyException; import static com.googlecode.totallylazy.predicates.Predicates.notNullValue; import static com.googlecode.totallylazy.predicates.Predicates.or; import static com.googlecode.totallylazy.Sequences.characters; import static com.googlecode.totallylazy.Sequences.repeat; import static com.googlecode.totallylazy.Sequences.sequence; import static com.googlecode.totallylazy.Streams.inputStreamReader; import static com.googlecode.totallylazy.Strings.toString; import static com.googlecode.totallylazy.io.Uri.uri; public class Strings { public static final String EMPTY = ""; public static final Charset UTF8 = Charset.forName("UTF-8"); public static final Monoid<String> join = ConcatString.instance; public static Function1<String, Boolean> asBoolean() { return Boolean::parseBoolean; } public static Sequence<String> lines(File file) { return Streams.lines(file).memorise(); } public static Sequence<String> lines(InputStream stream) { return Streams.lines(stream).memorise(); } public static Sequence<String> lines(Reader reader) { return Streams.lines(reader).memorise(); } public static Sequence<String> lines(String lines) { return Streams.lines(lines).memorise(); } public static Function0<String> readLine(final BufferedReader reader) { return Streams.readLine(reader); } public static Function1<String, String> toLowerCase() { return String::toLowerCase; } public static Function1<String, String> replace(final char oldChar, final char newChar) { return value -> value.replace(oldChar, newChar); } public static Function1<String, String> replace(final CharSequence target, final CharSequence replacement) { return value -> value.replace(target, replacement); } public static Function1<String, String> replaceAll(final String regex, final String replacement) { return value -> value.replaceAll(regex, replacement); } public static Function1<String, String> replaceFirst(final String regex, final String replacement) { return value -> value.replaceFirst(regex, replacement); } public static Function1<String, String> toUpperCase() { return String::toUpperCase; } public static LogicalPredicate<String> startsWith(final String value) { return new StartsWithPredicate(value); } public static Function1<String, Predicate<String>> startsWith() { return Strings::startsWith; } public static LogicalPredicate<String> startsWith(String first, String... rest) { return or(sequence(rest).cons(first).map(startsWith())); } public static LogicalPredicate<String> endsWith(final String value) { return new EndsWithPredicate(value); } public static Function1<String, Predicate<String>> endsWith() { return Strings::endsWith; } public static LogicalPredicate<String> endsWith(String first, String... rest) { return or(sequence(rest).cons(first).map(endsWith())); } public static LogicalPredicate<String> contains(final String value) { return new ContainsPredicate(value); } public static Function1<String, Predicate<String>> equalIgnoringCase() { return Strings::equalIgnoringCase; } public static LogicalPredicate<String> equalIgnoringCase(final String expected) { return new LogicalPredicate<String>() { public boolean matches(String actual) { return expected.equalsIgnoreCase(actual); } }; } public static LogicalPredicate<String> empty = new LogicalPredicate<String>() { public boolean matches(String value) { return isEmpty(value); } }; public static LogicalPredicate<String> empty() { return empty; } public static LogicalPredicate<String> blank = new LogicalPredicate<String>() { public boolean matches(String value) { return isBlank(value); } }; public static LogicalPredicate<String> blank() { return blank; } public static boolean isEmpty(String value) { return value == null || value.equals(EMPTY); } public static boolean isBlank(String value) { return isEmpty(value) || isEmpty(value.trim()); } public static LogicalPredicate<Character> unicodeControlOrUndefinedCharacter() { return new LogicalPredicate<Character>() { public boolean matches(Character character) { return character > 0x7F; } }; } public static String capitalise(String value) { if (isEmpty(value)) return value; return String.valueOf(Character.toTitleCase(value.charAt(0))) + value.substring(1); } public static String asString(Object value) { return value == null ? "" : value.toString(); } private static multi multi; public static String string(Object value) { if(multi == null) multi = new multi(){}; return multi.<String>methodOption(value).getOrElse(String.valueOf(value)); } @multimethod public static String string(Void value) { return ""; } @multimethod public static String string(byte[] value) { return toString(value); } @multimethod public static String string(File value) { return toString(value); } @multimethod public static String string(InputStream value) { return toString(value); } @multimethod public static String string(Reader value) { return toString(value); } public static String toString(byte[] bytes) { return new String(bytes, UTF8); } public static String toString(File file) { try { return toString(new FileInputStream(file)); } catch (FileNotFoundException e) { throw lazyException(e); } } public static String toString(final InputStream stream) { if (stream == null) return EMPTY; return using(stream, inputStream -> toString(inputStreamReader(inputStream))); } public static String toString(Reader reader) { return using(reader, reader1 -> { StringBuilder builder = new StringBuilder(); char[] buffer = new char[512]; int read = reader1.read(buffer); while (read > 0) { builder.append(buffer, 0, read); read = reader1.read(buffer); } return builder.toString(); }); } public static Function1<Object, String> format(final String format) { return value -> String.format(format, value); } public static Function1<CharSequence, Sequence<Character>> toCharacters() { return Sequences::characters; } public static Function1<String, String> reverse() { return Strings::reverse; } public static Function1<String, Sequence<String>> split(final String regex) { if (regex == null) throw new IllegalArgumentException("regex cannot be null"); return s -> sequence(s.split(regex)); } public static Function1<String, String> substring(final int beginIndex, final int endIndex) { return value -> substring(value, beginIndex, endIndex); } public static String reverse(String original) { return new StringBuilder(original).reverse().toString(); } @tailrec public static String substring(String original, int beginIndex, int endIndex) { int length = original.length(); int beginIndexPositive = toPositive(length, beginIndex); int endIndexPositive = toPositive(length, endIndex); if (beginIndexPositive > endIndexPositive) { return substring(reverse(original), length - beginIndexPositive, length - endIndexPositive); } return original.substring(beginIndexPositive, endIndexPositive); } private static int toPositive(int stringLength, int index) { if (index < 0) { return stringLength + index; } return index; } public static Function1<String, Character> characterAt(final int index) { return s -> s.charAt(index); } public static Function1<String, String> trim() { return String::trim; } public static LogicalPredicate<String> palindrome = new LogicalPredicate<String>() { @Override public boolean matches(String other) { return Strings.isPalindrome(other); } }; public static LogicalPredicate<String> isPalindrome() { return palindrome; } public static boolean isPalindrome(String other) { return other.equals(reverse(other)); } public static byte[] bytes(String value) { return value.getBytes(UTF8); } public static Maximum.Function<String> maximum = Maximum.constructors.maximum((String) null); public static Minimum.Function<String> minimum = Minimum.constructors.minimum((String) null); public static class functions { public static Curried3<String, String, String, String> replaceAll = (regex, replacemenent, source) -> Strings.replaceAll(regex, replacemenent).apply(source); } }
32.508143
112
0.67485
f6cbc705894b72ec263776d062b15ffae5a50715
2,343
// Copyright 2020 dataFascia Corporation // // 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.datafascia.common.reflect; import java.lang.annotation.Annotation; import java.util.Set; import lombok.extern.slf4j.Slf4j; import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; import org.reflections.scanners.TypeAnnotationsScanner; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.reflections.util.FilterBuilder; /** * Utility functions for package associated functions */ @Slf4j public class PackageUtils { /** * @param packageName the package name to get all classes of * * @return the set of classes in the package */ public static Set<Class<?>> classes(String packageName) { Reflections reflections = new Reflections(new ConfigurationBuilder() .setScanners(new SubTypesScanner(false)) .setUrls(ClasspathHelper.forPackage(packageName)) .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName)))); return reflections.getSubTypesOf(Object.class); } /** * @param packageName the package name to get all classes of * @param annotation the annotation class * * @return list of classes in package having the particular type annotation */ public static Set<Class<?>> withTypeAnnotations(String packageName, Class<? extends Annotation> annotation) { Reflections reflections = new Reflections(new ConfigurationBuilder() .setScanners(new SubTypesScanner(false), new TypeAnnotationsScanner()) .setUrls(ClasspathHelper.forPackage(packageName)) .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName)))); return reflections.getTypesAnnotatedWith(annotation); } private PackageUtils() { } }
36.609375
89
0.755869
305016f1f52a0bf7c6fe909cf0d2c2f795f9267e
347
package br.com.abril.fera.dao; import java.util.List; import br.com.abril.fera.model.CreatePage; public interface CreatePageDAO { public List<CreatePage> list(); public CreatePage get(String id); public void saveOrUpdate(CreatePage createpage); public void delete(String id); public List<CreatePage> listByProductId(Integer id); }
17.35
53
0.766571
32b93711e6f4564764c9b06904ac6058d9d6da6a
674
package com.jira.client.web.model.webhook; import com.alibaba.fastjson.annotation.JSONField; import com.jira.client.web.model.webhook.isuue.IssueDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; /** * @author XIAXINYU3 * @date 2020/11/27 */ @Getter @Setter @ToString @Builder @AllArgsConstructor @NoArgsConstructor @ApiModel("问题Webhook报文") public class JiraWebhookDTO { @ApiModelProperty("创建时间") private Long timestamp; @ApiModelProperty("问题类型") @JSONField(name = "issue_event_type_name") private String issue_event_type_name; @ApiModelProperty("问题主题") private IssueDTO issue; }
21.741935
56
0.762611
53d4e0ce537a4072efff844185882641e016a065
8,892
package me.ningsk.common.gl; import android.opengl.GLSurfaceView; import android.util.Log; import android.view.SurfaceView; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import static me.ningsk.common.global.JRTag.TAG; /** * <p>描述:<p> * 作者:ningsk<br> * 日期:2018/11/16 09 32<br> * 版本:v1.0<br> */ public class GLCore { private static Object sGLContext = new Object(); private static int sGLCount = 0; private static long sToken = 0L; private static LinkedHashMap<Callback, WeakReference<SurfaceView>> sPendingGLUsers = new LinkedHashMap(); private static long mExecutingThreadCount = 0L; public static Object sReleaseLocker = new Object(); public GLCore() { } public static boolean isGLContextAvailable(String tag, long token) { Object var3 = sGLContext; synchronized(sGLContext) { return isTokenValid(token) && mExecutingThreadCount == 0L; } } public static void useGLContext(String tag, SurfaceView surfaceView, final GLCore.Callback callback, long token) { Object var5 = sGLContext; synchronized(sGLContext) { if (isTokenValid(token)) { if (mExecutingThreadCount == 0L) { Log.d(TAG, "Tag useGLContext::" + tag + ",token is simple, directly executing, token " + token); callback.onGLContextAvailable(); } else { ++mExecutingThreadCount; if (surfaceView instanceof GLSurfaceView) { Log.d(TAG, "useGLContext::do gl callback, token " + token + ", sToken " + sToken); ((GLSurfaceView)surfaceView).queueEvent(() -> { try { callback.onGLContextAvailable(); GLCore.mExecutingThreadCount--; } catch (Exception e) { ; } }); } else { Log.d(TAG, "useGLContext::do main callback, token " + token + ", sToken " + sToken); surfaceView.post(() -> { try { callback.onGLContextAvailable(); GLCore.mExecutingThreadCount--; } catch (Exception e) { ; } }); } } } else { if (sGLCount > 0) { Log.d(TAG, "Tag:" + tag + ",useGLContext sGLContext , but need waiting, token " + token + ", sToken " + sToken); surfaceView.setTag(token); sPendingGLUsers.put(callback, new WeakReference(surfaceView)); } else { Log.d(TAG, "Tag:" + tag + ",useGLContext sGLContext, no thread use GL Context, token " + token); callback.onGLContextAvailable(); ++sGLCount; sToken = token; } } } } public static void releaseGLContext(String tag, long token) { Object var3 = sGLContext; synchronized(sGLContext) { if (sToken != token) { Log.e(TAG, "Tag:" + tag + ",invalid token " + token + ", cannot release gl context"); } else { Log.d(TAG, "Tag:" + tag + ",releaseGLContext , sGLCount = " + sGLCount + ", sToken = " + sToken); if (sPendingGLUsers.size() == 0) { --sGLCount; } else { Log.d(TAG, "Tag:" + tag + ",Has next GLContext user waiting for it, mExecutingThreadCount = " + mExecutingThreadCount); Set mapSet = sPendingGLUsers.entrySet(); ArrayList var6 = new ArrayList(); GLCore.Callback nextFirstCallback = null; Iterator var8 = mapSet.iterator(); SurfaceView nextView; Map.Entry var9; GLCore.Callback var10; long var11; while(var8.hasNext()) { var9 = (Map.Entry)var8.next(); var10 = (GLCore.Callback)var9.getKey(); if (nextFirstCallback == null) { nextFirstCallback = var10; } nextView = (SurfaceView)((WeakReference)var9.getValue()).get(); if (nextView != null) { var11 = (Long)nextView.getTag(); Log.d(TAG, "collect removeItem NextToken : " + var11); if (var11 == sToken) { var6.add(var10); } } else { Log.d(TAG, "collect removeItem:SurfaceView is destroyed, so skip to execute callback"); } } mExecutingThreadCount = (long)var6.size(); Log.d(TAG, "removeItem Size:" + mExecutingThreadCount + ", sPendingGLUsers Size:" + sPendingGLUsers.size()); if (mExecutingThreadCount == 0L) { Log.d(TAG, "remove item size is 0, so need other token to continue executing"); sToken = 0L; var8 = mapSet.iterator(); while(var8.hasNext()) { var9 = (Map.Entry)var8.next(); var10 = (GLCore.Callback)var9.getKey(); nextView = (SurfaceView)((WeakReference)var9.getValue()).get(); if (nextView != null) { var11 = (Long)nextView.getTag(); Log.d(TAG, "other token NextToken:" + var11); if (sToken == 0L) { sToken = var11; } if (var11 == sToken) { var6.add(var10); } } else { Log.d(TAG, "other token:SurfaceView is destroyed, so skip to execute callback"); } } mExecutingThreadCount = (long)var6.size(); } var8 = var6.iterator(); while(var8.hasNext()) { final GLCore.Callback callback = (GLCore.Callback)var8.next(); nextView = (SurfaceView)((WeakReference)sPendingGLUsers.get(callback)).get(); if (nextView != null) { if (nextView instanceof GLSurfaceView) { Log.d(TAG, "do gl callback, token " + nextView.getTag() + ", sToken " + sToken); ((GLSurfaceView)nextView).queueEvent(new Runnable() { public void run() { try { callback.onGLContextAvailable(); GLCore.mExecutingThreadCount--; } catch (Exception e) { ; } } }); } else { Log.d(TAG, "do main callback, token " + nextView.getTag() + ", sToken " + sToken); nextView.post(() -> { try { callback.onGLContextAvailable(); GLCore.mExecutingThreadCount--; } catch (Exception e) { ; } }); } sPendingGLUsers.remove(callback); } else { Log.d(TAG, "iterator removeItem:SurfaceView is destroyed, so skip to execute callback"); } } } } } } private static boolean isTokenValid(long token) { return sToken == token && token > 0L; } public interface Callback { void onGLContextAvailable(); } }
42.14218
139
0.425551
590b2f4e95bff532c60a51827ad7d9388cea546d
288
package cn.kgc.kade2015.mycampus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Test { private static final Logger log = LoggerFactory.getLogger(Test.class); public static void main(String[] args) { log.info("hello world"); log.debug("debug hello"); } }
22.153846
71
0.739583
939e4066a126770ad9e60ed696ab7f91d1fe605f
1,200
package com.ck.syscheck.model; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; import java.util.Date; import java.util.Set; /** * 资源表 * Create by ck on 2019/6/17 */ @Data public class SysResource implements Serializable{ private static final long serialVersionUID = 5285808128164208232L; /** * 主键 */ private Integer id; /** * 资源名称 */ private String code; /** * 资源描述 */ private String name; /** * 父资源编码->菜单 */ private Integer parentId; /** * 访问地址URL */ private String uri; /** * 类型 1:菜单menu 2:资源element(rest-api) 3:资源分类 */ private Short type; /** * 访问方式 GET POST PUT DELETE PATCH */ private String method; /** * 图标 */ private String icon; /** * 状态 1:正常、9:禁用 */ private Short status; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** * 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** * 子菜单 */ private Set<SysResource> submenu; }
15
70
0.553333
378e0c63c9df8b5a337e1591003bdc0c0ac40e95
2,113
/* * Copyright 2015 Ripple OSI * * 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 org.rippleosi.patient.careplans.model; import java.io.Serializable; /** */ public class CarePlanDetails implements Serializable { private String source; private String sourceId; private CareDocument careDocument; private CPRDecision cprDecision; private PrioritiesOfCare prioritiesOfCare; private TreatmentDecision treatmentDecision; public String getSource() { return source; } public void setSource(String source) { this.source = source; } public String getSourceId() { return sourceId; } public void setSourceId(String sourceId) { this.sourceId = sourceId; } public CareDocument getCareDocument() { return careDocument; } public void setCareDocument(CareDocument careDocument) { this.careDocument = careDocument; } public CPRDecision getCprDecision() { return cprDecision; } public void setCprDecision(CPRDecision cprDecision) { this.cprDecision = cprDecision; } public PrioritiesOfCare getPrioritiesOfCare() { return prioritiesOfCare; } public void setPrioritiesOfCare(PrioritiesOfCare prioritiesOfCare) { this.prioritiesOfCare = prioritiesOfCare; } public TreatmentDecision getTreatmentDecision() { return treatmentDecision; } public void setTreatmentDecision(TreatmentDecision treatmentDecision) { this.treatmentDecision = treatmentDecision; } }
26.746835
78
0.699479
1c346bf3eeea53e58b4d50f7ce7f660446508421
303
package br.com.zupedu.gui.mercado_livre.produto.pergunta; public class ProdutoPerguntaResponse { private String titulo; public ProdutoPerguntaResponse(ProdutoPergunta pergunta) { this.titulo = pergunta.getTitulo(); } public String getTitulo() { return titulo; } }
21.642857
62
0.706271
61fc7cf718754cc0351798de2c93a58b9df1dfe3
6,522
package fr.free.nrw.commons.mwapi; import org.apache.http.cookie.Cookie; import org.apache.http.impl.client.AbstractHttpClient; import org.apache.http.impl.cookie.BasicClientCookie; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.List; import in.yuvi.http.fluent.Http; import in.yuvi.http.fluent.ProgressListener; import timber.log.Timber; public class CustomMwApi { public class RequestBuilder { private HashMap<String, Object> params; private CustomMwApi api; RequestBuilder(CustomMwApi api) { params = new HashMap<String, Object>(); this.api = api; } public RequestBuilder param(String key, Object value) { params.put(key, value); return this; } public CustomApiResult get() throws IOException { return api.makeRequest("GET", params); } public CustomApiResult post() throws IOException { return api.makeRequest("POST", params); } } private AbstractHttpClient client; private String apiURL; public boolean isLoggedIn; private String authCookie = null; private String userName = null; private String userID = null; public CustomMwApi(String apiURL, AbstractHttpClient client) { this.apiURL = apiURL; this.client = client; } public RequestBuilder action(String action) { RequestBuilder builder = new RequestBuilder(this); builder.param("action", action); return builder; } public String getAuthCookie() { if(authCookie == null){ authCookie = ""; List<Cookie> cookies = client.getCookieStore().getCookies(); for(Cookie cookie: cookies) { authCookie += cookie.getName() + "=" + cookie.getValue() + ";"; } } return authCookie; } public void setAuthCookie(String authCookie) { this.authCookie = authCookie; this.isLoggedIn = true; String[] cookies = authCookie.split(";"); String domain; try { domain = new URL(apiURL).getHost(); } catch (MalformedURLException e) { // Mighty well better not happen! e.printStackTrace(); throw new RuntimeException(e); } // This works because I know which cookies are going to be set by MediaWiki, and they don't contain a = or ; in them :D for(String cookie: cookies) { String[] parts = cookie.split("="); BasicClientCookie c = new BasicClientCookie(parts[0], parts[1]); c.setDomain(domain); client.getCookieStore().addCookie(c); } } public void removeAllCookies() { client.getCookieStore().clear(); } public boolean validateLogin() throws IOException { CustomApiResult userMeta = this.action("query").param("meta", "userinfo").get(); this.userID = userMeta.getString("/api/query/userinfo/@id"); this.userName = userMeta.getString("/api/query/userinfo/@name"); Timber.d("User id is %s and user name is %s", userID, userName); return !userID.equals("0"); } public String getUserID() throws IOException { if(this.userID == null || this.userID.equals("0")) { this.validateLogin(); } return userID; } public String getUserName() throws IOException { if(this.userID == null || this.userID.equals("0")) { this.validateLogin(); } return userName; } public String login(String username, String password) throws IOException { CustomApiResult tokenData = this.action("login").param("lgname", username).param("lgpassword", password).post(); String result = tokenData.getString("/api/login/@result"); if (result.equals("NeedToken")) { String token = tokenData.getString("/api/login/@token"); CustomApiResult confirmData = this.action("login").param("lgname", username).param("lgpassword", password).param("lgtoken", token).post(); String finalResult = confirmData.getString("/api/login/@result"); if(finalResult.equals("Success")) { isLoggedIn = true; } return finalResult; } else { return result; } } public CustomApiResult upload(String filename, InputStream file, long length, String text, String comment, String centralAuthToken, String token) throws IOException { return this.upload(filename, file, length, text, comment,centralAuthToken, token, null); } public CustomApiResult upload(String filename, InputStream file, String text, String comment, String centralAuthToken, String token) throws IOException { return this.upload(filename, file, -1, text, comment,centralAuthToken, token, null); } public CustomApiResult upload(String filename, InputStream file, long length, String text, String comment, String centralAuthToken, String token, ProgressListener uploadProgressListener) throws IOException { Http.HttpRequestBuilder builder = Http.multipart(apiURL) .data("action", "upload") .data("token", token) .data("centralauthtoken", centralAuthToken) .data("text", text) .data("ignorewarnings", "1") .data("comment", comment) .data("filename", filename) .sendProgressListener(uploadProgressListener); if(length != -1) { builder.file("file", filename, file, length); } else { builder.file("file", filename, file); } return CustomApiResult.fromRequestBuilder(builder, client); } public void logout() throws IOException { // I should be doing more validation here, but meh isLoggedIn = false; this.action("logout").post(); removeAllCookies(); authCookie = null; } private CustomApiResult makeRequest(String method, HashMap<String, Object> params) throws IOException { Http.HttpRequestBuilder builder; if (method.equals("POST")) { builder = Http.post(apiURL); } else { builder = Http.get(apiURL); } builder.data(params); return CustomApiResult.fromRequestBuilder(builder, client); } } ;
36.233333
211
0.621742
8bb1ab63ff26008c1c689cca426ce2efbcd22fea
408
package io.nuls.rpc.sdk.entity; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** * @author: Charlie * @date: 2018/3/28 */ public class InputNa2NulsDto extends InputDto { public InputNa2NulsDto(Map<String, Object> map) { super(map); } @JsonProperty("value") private String getValue2Nuls(){ return Na.valueOf(getValue()).toText(); } }
18.545455
53
0.669118
46788571199ff3d3fb179afdc935486f346badbe
5,504
/******************************************************************************* * Copyright (c) 2005, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.pde.internal.ui.nls; import java.util.Properties; import org.eclipse.core.runtime.CoreException; import org.eclipse.pde.core.plugin.IFragmentModel; import org.eclipse.pde.internal.core.text.IDocumentAttributeNode; import org.eclipse.pde.internal.core.text.IDocumentTextNode; import org.eclipse.pde.internal.core.text.bundle.ManifestHeader; import org.eclipse.pde.internal.core.text.plugin.*; public class ModelChangeElement { //$NON-NLS-1$ private static final String DELIM = "."; //$NON-NLS-1$ private static final String KEY_PREFIX = "%"; //$NON-NLS-1$ private static final String FRAGMENT_PREFIX = "f"; //$NON-NLS-1$ private String fValue = ""; //$NON-NLS-1$ private String fKey = ""; private int fOffset = 0; private int fLength = 0; private boolean fExternalized = true; private ModelChange fParent; private Object fUnderlying; public ModelChangeElement(ModelChange parent, Object incoming) { fParent = parent; fUnderlying = incoming; if (incoming instanceof PluginElementNode) { PluginElementNode elem = (PluginElementNode) incoming; IDocumentTextNode text = elem.getTextNode(); fValue = elem.getText(); generateValidKey(elem.getParent().getName(), elem.getName()); fOffset = text.getOffset(); fLength = text.getLength(); } else if (incoming instanceof PluginAttribute) { PluginAttribute attr = (PluginAttribute) incoming; fValue = attr.getValue(); generateValidKey(attr.getEnclosingElement().getXMLTagName(), attr.getName()); fOffset = attr.getValueOffset(); fLength = attr.getValueLength(); } else if (incoming instanceof PluginExtensionPointNode) { PluginExtensionPointNode extP = (PluginExtensionPointNode) incoming; fValue = extP.getName(); //$NON-NLS-1$ //$NON-NLS-2$ generateValidKey("extension-point", "name"); //$NON-NLS-1$ IDocumentAttributeNode attr = extP.getDocumentAttribute("name"); fOffset = attr.getValueOffset(); fLength = attr.getValueLength(); } else if (incoming instanceof ManifestHeader) { ManifestHeader header = (ManifestHeader) incoming; fValue = header.getValue(); generateValidKey(header.getName()); fLength = fValue.length(); fOffset = header.getOffset() + header.getLength() - header.getLineLimiter().length() - fLength; } } public String getKey() { return fKey; } public void setKey(String key) { fKey = key; } public String getValue() { return fValue; } public void setValue(String value) { fValue = value; } public boolean isExternalized() { return fExternalized; } public void setExternalized(boolean externalzied) { fExternalized = externalzied; } public int getOffset() { return fOffset; } public int getLength() { return fLength; } private void generateValidKey(String pre, String mid) { generateValidKey(pre + DELIM + mid); } private void generateValidKey(String key) { Properties properties = fParent.getProperties(); fKey = key; // Only generate counter with key, if key already exists in properties if (properties.containsKey(fKey)) { String delimiter = fParent.getParentModel() instanceof IFragmentModel ? DELIM + FRAGMENT_PREFIX : DELIM; int suffix = 0; while (properties.containsKey(fKey + delimiter + suffix)) suffix += 1; fKey += delimiter + suffix; } properties.setProperty(fKey, fValue); } public String getExternKey() { return KEY_PREFIX + fKey; } public boolean updateValue() { try { String key = getExternKey(); if (fUnderlying instanceof PluginElementNode) { PluginElementNode elem = (PluginElementNode) fUnderlying; elem.setText(key); } else if (fUnderlying instanceof PluginAttribute) { PluginAttribute attr = (PluginAttribute) fUnderlying; String attrName = attr.getName(); attr.getEnclosingElement().setXMLAttribute(attrName, key); } else if (fUnderlying instanceof PluginExtensionPointNode) { PluginExtensionPointNode extP = (PluginExtensionPointNode) fUnderlying; extP.setName(key); } else if (fUnderlying instanceof ManifestHeader) { ManifestHeader header = (ManifestHeader) fUnderlying; header.setValue(key); } else return false; } catch (CoreException e) { return false; } return true; } }
34.616352
116
0.610465
9c05f3dce38a2e9713a84ccf9e6737a7f8a537dd
47,351
/* * 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.github.housepower.settings; import com.github.housepower.misc.StrUtil; import com.github.housepower.misc.Validate; import com.github.housepower.serde.SettingType; import java.io.Serializable; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; public class SettingKey implements Serializable { // key always is lower case private static final Map<String, SettingKey> DEFINED_SETTING_KEYS = new ConcurrentHashMap<>(); public static SettingKey min_compress_block_size = SettingKey.builder() .withName("min_compress_block_size") .withType(SettingType.Int64) .withDescription("The actual size of the block to compress, if the uncompressed data less than max_compress_block_size is no less than this value and no less than the volume of data for one mark.") .build(); public static SettingKey max_compress_block_size = SettingKey.builder() .withName("max_compress_block_size") .withType(SettingType.Int64) .withDescription("The maximum size of blocks of uncompressed data before compressing for writing to a table.") .build(); public static SettingKey max_block_size = SettingKey.builder() .withName("max_block_size") .withType(SettingType.Int64) .withDescription("Maximum block size for reading") .build(); public static SettingKey max_insert_block_size = SettingKey.builder() .withName("max_insert_block_size") .withType(SettingType.Int64) .withDescription("The maximum block size for insertion, if we control the creation of blocks for insertion.") .build(); public static SettingKey min_insert_block_size_rows = SettingKey.builder() .withName("min_insert_block_size_rows") .withType(SettingType.Int64) .withDescription("Squash blocks passed to INSERT query to specified size in rows, if blocks are not big enough.") .build(); public static SettingKey min_insert_block_size_bytes = SettingKey.builder() .withName("min_insert_block_size_bytes") .withType(SettingType.Int64) .withDescription("Squash blocks passed to INSERT query to specified size in bytes, if blocks are not big enough.") .build(); public static SettingKey max_read_buffer_size = SettingKey.builder() .withName("max_read_buffer_size") .withType(SettingType.Int64) .withDescription("The maximum size of the buffer to read from the filesystem.") .build(); public static SettingKey max_distributed_connections = SettingKey.builder() .withName("max_distributed_connections") .withType(SettingType.Int64) .withDescription("The maximum number of connections for distributed processing of one query (should be greater than max_threads).") .build(); public static SettingKey max_query_size = SettingKey.builder() .withName("max_query_size") .withType(SettingType.Int64) .withDescription("Which part of the query can be read into RAM for parsing (the remaining data for INSERT, if any, is read later)") .build(); public static SettingKey interactive_delay = SettingKey.builder() .withName("interactive_delay") .withType(SettingType.Int64) .withDescription("The interval in microseconds to check if the request is cancelled, and to send progress info.") .build(); public static SettingKey connect_timeout = SettingKey.builder() .withName("connect_timeout") .withType(SettingType.Seconds) .withDescription("Connection timeout if there are no replicas.") .build(); public static SettingKey connect_timeout_with_failover_ms = SettingKey.builder() .withName("connect_timeout_with_failover_ms") .withType(SettingType.Milliseconds) .withDescription("Connection timeout for selecting first healthy replica.") .build(); public static SettingKey queue_max_wait_ms = SettingKey.builder() .withName("queue_max_wait_ms") .withType(SettingType.Milliseconds) .withDescription("The wait time in the request queue, if the number of concurrent requests exceeds the maximum.") .build(); public static SettingKey poll_interval = SettingKey.builder() .withName("poll_interval") .withType(SettingType.Int64) .withDescription("Block at the query wait loop on the server for the specified number of seconds.") .build(); public static SettingKey distributed_connections_pool_size = SettingKey.builder() .withName("distributed_connections_pool_size") .withType(SettingType.Int64) .withDescription("Maximum number of connections with one remote server in the pool.") .build(); public static SettingKey connections_with_failover_max_tries = SettingKey.builder() .withName("connections_with_failover_max_tries") .withType(SettingType.Int64) .withDescription("The maximum number of attempts to connect to replicas.") .build(); public static SettingKey extremes = SettingKey.builder() .withName("extremes") .withType(SettingType.Bool) .withDescription("Calculate minimums and maximums of the result columns. They can be output in JSON-formats.") .build(); public static SettingKey use_uncompressed_cache = SettingKey.builder() .withName("use_uncompressed_cache") .withType(SettingType.Bool) .withDescription("Whether to use the cache of uncompressed blocks.") .build(); public static SettingKey replace_running_query = SettingKey.builder() .withName("replace_running_query") .withType(SettingType.Bool) .withDescription("Whether the running request should be canceled with the same id as the new one.") .build(); public static SettingKey background_pool_size = SettingKey.builder() .withName("background_pool_size") .withType(SettingType.Int64) .withDescription("Number of threads performing background work for tables (for example, merging in merge tree). Only has meaning at server startup.") .build(); public static SettingKey background_schedule_pool_size = SettingKey.builder() .withName("background_schedule_pool_size") .withType(SettingType.Int64) .withDescription("Number of threads performing background tasks for replicated tables. Only has meaning at server startup.") .build(); public static SettingKey distributed_directory_monitor_sleep_time_ms = SettingKey.builder() .withName("distributed_directory_monitor_sleep_time_ms") .withType(SettingType.Milliseconds) .withDescription("Sleep time for StorageDistributed DirectoryMonitors in case there is no work or exception has been thrown.") .build(); public static SettingKey distributed_directory_monitor_batch_inserts = SettingKey.builder() .withName("distributed_directory_monitor_batch_inserts") .withType(SettingType.Bool) .withDescription("Should StorageDistributed DirectoryMonitors try to batch individual inserts into bigger ones.") .build(); public static SettingKey optimize_move_to_prewhere = SettingKey.builder() .withName("optimize_move_to_prewhere") .withType(SettingType.Bool) .withDescription("Allows disabling WHERE to PREWHERE optimization in SELECT queries from MergeTree.") .build(); public static SettingKey replication_alter_partitions_sync = SettingKey.builder() .withName("replication_alter_partitions_sync") .withType(SettingType.Int64) .withDescription("Wait for actions to manipulate the partitions. 0 - do not wait, 1 - wait for execution only of itself, 2 - wait for everyone.") .build(); public static SettingKey replication_alter_columns_timeout = SettingKey.builder() .withName("replication_alter_columns_timeout") .withType(SettingType.Int64) .withDescription("Wait for actions to change the table structure within the specified number of seconds. 0 - wait unlimited time.") .build(); public static SettingKey totals_auto_threshold = SettingKey.builder() .withName("totals_auto_threshold") .withType(SettingType.Float32) .withDescription("The threshold for totals_mode = 'auto'.") .build(); public static SettingKey compile = SettingKey.builder() .withName("compile") .withType(SettingType.Bool) .withDescription("Whether query compilation is enabled.") .build(); public static SettingKey compile_expressions = SettingKey.builder() .withName("compile_expressions") .withType(SettingType.Bool) .withDescription("Compile some scalar functions and operators to native code.") .build(); public static SettingKey min_count_to_compile = SettingKey.builder() .withName("min_count_to_compile") .withType(SettingType.Int64) .withDescription("The number of structurally identical queries before they are compiled.") .build(); public static SettingKey group_by_two_level_threshold = SettingKey.builder() .withName("group_by_two_level_threshold") .withType(SettingType.Int64) .withDescription("From what number of keys, a two-level aggregation starts. 0 - the threshold is not set.") .build(); public static SettingKey group_by_two_level_threshold_bytes = SettingKey.builder() .withName("group_by_two_level_threshold_bytes") .withType(SettingType.Int64) .withDescription("From what size of the aggregation state in bytes, a two-level aggregation begins to be used. 0 - the threshold is not set. Two-level aggregation is used when at least one of the thresholds is triggered.") .build(); public static SettingKey distributed_aggregation_memory_efficient = SettingKey.builder() .withName("distributed_aggregation_memory_efficient") .withType(SettingType.Bool) .withDescription("Is the memory-saving mode of distributed aggregation enabled.") .build(); public static SettingKey aggregation_memory_efficient_merge_threads = SettingKey.builder() .withName("aggregation_memory_efficient_merge_threads") .withType(SettingType.Int64) .withDescription("Number of threads to use for merge intermediate aggregation results in memory efficient mode. When bigger, then more memory is consumed. 0 means - same as 'max_threads'.") .build(); public static SettingKey max_threads = SettingKey.builder() .withName("max_threads") .withType(SettingType.Int64) .withDescription("The maximum number of threads to execute the request. By default, it is determined automatically.") .build(); public static SettingKey max_parallel_replicas = SettingKey.builder() .withName("max_parallel_replicas") .withType(SettingType.Int64) .withDescription("The maximum number of replicas of each shard used when the query is executed. For consistency (to get different parts of the same partition), this option only works for the specified sampling key. The lag of the replicas is not controlled.") .build(); public static SettingKey skip_unavailable_shards = SettingKey.builder() .withName("skip_unavailable_shards") .withType(SettingType.Bool) .withDescription("Silently skip unavailable shards.") .build(); public static SettingKey distributed_group_by_no_merge = SettingKey.builder() .withName("distributed_group_by_no_merge") .withType(SettingType.Bool) .withDescription("Do not merge aggregation states from different servers for distributed query processing - in case it is for certain that there are different keys on different shards.") .build(); public static SettingKey merge_tree_min_rows_for_concurrent_read = SettingKey.builder() .withName("merge_tree_min_rows_for_concurrent_read") .withType(SettingType.Int64) .withDescription("If at least as many lines are read from one file, the reading can be parallelized.") .build(); public static SettingKey merge_tree_min_rows_for_seek = SettingKey.builder() .withName("merge_tree_min_rows_for_seek") .withType(SettingType.Int64) .withDescription("You can skip reading more than that number of rows at the price of one seek per file.") .build(); public static SettingKey merge_tree_coarse_index_granularity = SettingKey.builder() .withName("merge_tree_coarse_index_granularity") .withType(SettingType.Int64) .withDescription("If the index segment can contain the required keys, divide it into as many parts and recursively check them. ") .build(); public static SettingKey merge_tree_max_rows_to_use_cache = SettingKey.builder() .withName("merge_tree_max_rows_to_use_cache") .withType(SettingType.Int64) .withDescription("The maximum number of rows per request, to use the cache of uncompressed data. If the request is large, the cache is not used. (For large queries not to flush out the cache.)") .build(); public static SettingKey merge_tree_uniform_read_distribution = SettingKey.builder() .withName("merge_tree_uniform_read_distribution") .withType(SettingType.Bool) .withDescription("Distribute read from MergeTree over threads evenly, ensuring stable average execution time of each thread within one read operation.") .build(); public static SettingKey mysql_max_rows_to_insert = SettingKey.builder() .withName("mysql_max_rows_to_insert") .withType(SettingType.Int64) .withDescription("The maximum number of rows in MySQL batch insertion of the MySQL storage engine") .build(); public static SettingKey optimize_min_equality_disjunction_chain_length = SettingKey.builder() .withName("optimize_min_equality_disjunction_chain_length") .withType(SettingType.Int64) .withDescription("The minimum length of the expression `expr = x1 OR ... expr = xN` for optimization ") .build(); public static SettingKey min_bytes_to_use_direct_io = SettingKey.builder() .withName("min_bytes_to_use_direct_io") .withType(SettingType.Int64) .withDescription("The minimum number of bytes for input/output operations is bypassing the page cache. 0 - disabled.") .build(); public static SettingKey force_index_by_date = SettingKey.builder() .withName("force_index_by_date") .withType(SettingType.Bool) .withDescription("Throw an exception if there is a partition key in a table, and it is not used.") .build(); public static SettingKey force_primary_key = SettingKey.builder() .withName("force_primary_key") .withType(SettingType.Bool) .withDescription("Throw an exception if there is primary key in a table, and it is not used.") .build(); public static SettingKey mark_cache_min_lifetime = SettingKey.builder() .withName("mark_cache_min_lifetime") .withType(SettingType.Int64) .withDescription("If the maximum size of mark_cache is exceeded, delete only records older than mark_cache_min_lifetime seconds.") .build(); public static SettingKey max_streams_to_max_threads_ratio = SettingKey.builder() .withName("max_streams_to_max_threads_ratio") .withType(SettingType.Float32) .withDescription("Allows you to use more sources than the number of threads - to more evenly distribute work across threads. It is assumed that this is a temporary solution, since it will be possible in the future to make the number of sources equal to the number of threads, but for each source to dynamically select available work for itself.") .build(); public static SettingKey network_zstd_compression_level = SettingKey.builder() .withName("network_zstd_compression_level") .withType(SettingType.Int64) .withDescription("Allows you to select the level of ZSTD compression.") .build(); public static SettingKey priority = SettingKey.builder() .withName("priority") .withType(SettingType.Int64) .withDescription("Priority of the query. 1 - the highest, higher value - lower priority; 0 - do not use priorities.") .build(); public static SettingKey log_queries = SettingKey.builder() .withName("log_queries") .withType(SettingType.Bool) .withDescription("Log requests and write the log to the system table.") .build(); public static SettingKey log_queries_cut_to_length = SettingKey.builder() .withName("log_queries_cut_to_length") .withType(SettingType.Int64) .withDescription("If query length is greater than specified threshold (in bytes), then cut query when writing to query log. Also limit length of printed query in ordinary text log.") .build(); public static SettingKey max_concurrent_queries_for_user = SettingKey.builder() .withName("max_concurrent_queries_for_user") .withType(SettingType.Int64) .withDescription("The maximum number of concurrent requests per user.") .build(); public static SettingKey insert_deduplicate = SettingKey.builder() .withName("insert_deduplicate") .withType(SettingType.Bool) .withDescription("For INSERT queries in the replicated table, specifies that deduplication of insertings blocks should be preformed") .build(); public static SettingKey insert_quorum = SettingKey.builder() .withName("insert_quorum") .withType(SettingType.Int64) .withDescription("For INSERT queries in the replicated table, wait writing for the specified number of replicas and linearize the addition of the data. 0 - disabled.") .build(); public static SettingKey select_sequential_consistency = SettingKey.builder() .withName("select_sequential_consistency") .withType(SettingType.Int64) .withDescription("For SELECT queries from the replicated table, throw an exception if the replica does not have a chunk written with the quorum; do not read the parts that have not yet been written with the quorum.") .build(); public static SettingKey table_function_remote_max_addresses = SettingKey.builder() .withName("table_function_remote_max_addresses") .withType(SettingType.Int64) .withDescription("The maximum number of different shards and the maximum number of replicas of one shard in the `remote` function.") .build(); public static SettingKey read_backoff_min_latency_ms = SettingKey.builder() .withName("read_backoff_min_latency_ms") .withType(SettingType.Milliseconds) .withDescription("Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.") .build(); public static SettingKey read_backoff_max_throughput = SettingKey.builder() .withName("read_backoff_max_throughput") .withType(SettingType.Int64) .withDescription("Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.") .build(); public static SettingKey read_backoff_min_interval_between_events_ms = SettingKey.builder() .withName("read_backoff_min_interval_between_events_ms") .withType(SettingType.Milliseconds) .withDescription("Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.") .build(); public static SettingKey read_backoff_min_events = SettingKey.builder() .withName("read_backoff_min_events") .withType(SettingType.Int64) .withDescription("Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.") .build(); public static SettingKey memory_tracker_fault_probability = SettingKey.builder() .withName("memory_tracker_fault_probability") .withType(SettingType.Float32) .withDescription("For testing of `exception safety` - throw an exception every time you allocate memory with the specified probability.") .build(); public static SettingKey enable_http_compression = SettingKey.builder() .withName("enable_http_compression") .withType(SettingType.Bool) .withDescription("Compress the result if the client over HTTP said that it understands data compressed by gzip or deflate.") .build(); public static SettingKey http_zlib_compression_level = SettingKey.builder() .withName("http_zlib_compression_level") .withType(SettingType.Int64) .withDescription("Compression level - used if the client on HTTP said that it understands data compressed by gzip or deflate.") .build(); public static SettingKey http_native_compression_disable_checksumming_on_decompress = SettingKey.builder() .withName("http_native_compression_disable_checksumming_on_decompress") .withType(SettingType.Bool) .withDescription("If you uncompress the POST data from the client compressed by the native format, do not check the checksum.") .build(); public static SettingKey count_distinct_implementation = SettingKey.builder() .withName("count_distinct_implementation") .withType(SettingType.UTF8) .withDescription("What aggregate function to use for implementation of count(DISTINCT ...)") .build(); public static SettingKey output_format_write_statistics = SettingKey.builder() .withName("output_format_write_statistics") .withType(SettingType.Bool) .withDescription("Write statistics about read rows, bytes, time elapsed in suitable output formats.") .build(); public static SettingKey add_http_cors_header = SettingKey.builder() .withName("add_http_cors_header") .withType(SettingType.Bool) .withDescription("Write add http CORS header.") .build(); public static SettingKey input_format_skip_unknown_fields = SettingKey.builder() .withName("input_format_skip_unknown_fields") .withType(SettingType.Bool) .withDescription("Skip columns with unknown names from input data (it works for JSONEachRow and TSKV formats).") .build(); public static SettingKey input_format_values_interpret_expressions = SettingKey.builder() .withName("input_format_values_interpret_expressions") .withType(SettingType.Bool) .withDescription("For Values format: if field could not be parsed by streaming parser, run SQL parser and try to interpret it as SQL expression.") .build(); public static SettingKey output_format_json_quote_64bit_integers = SettingKey.builder() .withName("output_format_json_quote_64bit_integers") .withType(SettingType.Bool) .withDescription("Controls quoting of 64-bit integers in JSON output format.") .build(); public static SettingKey output_format_json_quote_denormals = SettingKey.builder() .withName("output_format_json_quote_denormals") .withType(SettingType.Bool) .withDescription("Enables '+nan', '-nan', '+inf', '-inf' outputs in JSON output format.") .build(); public static SettingKey output_format_pretty_max_rows = SettingKey.builder() .withName("output_format_pretty_max_rows") .withType(SettingType.Int64) .withDescription("Rows limit for Pretty formats.") .build(); public static SettingKey use_client_time_zone = SettingKey.builder() .withName("use_client_time_zone") .withType(SettingType.Bool) .withDescription("Use client timezone for interpreting DateTime string values, instead of adopting server timezone.") .build(); public static SettingKey send_progress_in_http_headers = SettingKey.builder() .withName("send_progress_in_http_headers") .withType(SettingType.Bool) .withDescription("Send progress notifications using X-ClickHouse-Progress headers. Some clients do not support high amount of HTTP headers (Python requests in particular), so it is disabled by default.") .build(); public static SettingKey http_headers_progress_interval_ms = SettingKey.builder() .withName("http_headers_progress_interval_ms") .withType(SettingType.Int64) .withDescription("Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.") .build(); public static SettingKey fsync_metadata = SettingKey.builder() .withName("fsync_metadata") .withType(SettingType.Bool) .withDescription("Do fsync after changing metadata for tables and databases (.sql files). Could be disabled in case of poor latency on server with high load of DDL queries and high load of disk subsystem.") .build(); public static SettingKey input_format_allow_errors_num = SettingKey.builder() .withName("input_format_allow_errors_num") .withType(SettingType.Int64) .withDescription("Maximum absolute amount of errors while reading text formats (like CSV, TSV). In case of error, if both absolute and relative values are non-zero, and at least absolute or relative amount of errors is lower than corresponding value, will skip until next line and continue.") .build(); public static SettingKey input_format_allow_errors_ratio = SettingKey.builder() .withName("input_format_allow_errors_ratio") .withType(SettingType.Float32) .withDescription("Maximum relative amount of errors while reading text formats (like CSV, TSV). In case of error, if both absolute and relative values are non-zero, and at least absolute or relative amount of errors is lower than corresponding value, will skip until next line and continue.") .build(); public static SettingKey join_use_nulls = SettingKey.builder() .withName("join_use_nulls") .withType(SettingType.Bool) .withDescription("Use NULLs for non-joined rows of outer JOINs. If false, use default value of corresponding columns data type.") .build(); public static SettingKey max_replica_delay_for_distributed_queries = SettingKey.builder() .withName("max_replica_delay_for_distributed_queries") .withType(SettingType.Int64) .withDescription("If set, distributed queries of Replicated tables will choose servers with replication delay in seconds less than the specified value (not inclusive). Zero means do not take delay into account.") .build(); public static SettingKey fallback_to_stale_replicas_for_distributed_queries = SettingKey.builder() .withName("fallback_to_stale_replicas_for_distributed_queries") .withType(SettingType.Bool) .withDescription("Suppose max_replica_delay_for_distributed_queries is set and all replicas for the queried table are stale. If this setting is enabled, the query will be performed anyway, otherwise the error will be reported.") .build(); public static SettingKey preferred_max_column_in_block_size_bytes = SettingKey.builder() .withName("preferred_max_column_in_block_size_bytes") .withType(SettingType.Int64) .withDescription("Limit on max column size in block while reading. Helps to decrease cache misses count. Should be close to L2 cache size.") .build(); public static SettingKey insert_distributed_sync = SettingKey.builder() .withName("insert_distributed_sync") .withType(SettingType.Bool) .withDescription("If setting is enabled, insert query into distributed waits until data will be sent to all nodes in cluster.") .build(); public static SettingKey insert_distributed_timeout = SettingKey.builder() .withName("insert_distributed_timeout") .withType(SettingType.Int64) .withDescription("Timeout for insert query into distributed. Setting is used only with insert_distributed_sync enabled. Zero value means no timeout.") .build(); public static SettingKey distributed_ddl_task_timeout = SettingKey.builder() .withName("distributed_ddl_task_timeout") .withType(SettingType.Int64) .withDescription("Timeout for DDL query responses from all hosts in cluster. Negative value means infinite.") .build(); public static SettingKey stream_flush_interval_ms = SettingKey.builder() .withName("stream_flush_interval_ms") .withType(SettingType.Milliseconds) .withDescription("Timeout for flushing data from streaming storages.") .build(); public static SettingKey format_schema = SettingKey.builder() .withName("format_schema") .withType(SettingType.UTF8) .withDescription("Schema identifier (used by schema-based formats)") .build(); public static SettingKey insert_allow_materialized_columns = SettingKey.builder() .withName("insert_allow_materialized_columns") .withType(SettingType.Bool) .withDescription("If setting is enabled, Allow materialized columns in INSERT.") .build(); public static SettingKey http_connection_timeout = SettingKey.builder() .withName("http_connection_timeout") .withType(SettingType.Seconds) .withDescription("HTTP connection timeout.") .build(); public static SettingKey http_send_timeout = SettingKey.builder() .withName("http_send_timeout") .withType(SettingType.Seconds) .withDescription("HTTP send timeout") .build(); public static SettingKey http_receive_timeout = SettingKey.builder() .withName("http_receive_timeout") .withType(SettingType.Seconds) .withDescription("HTTP receive timeout") .build(); public static SettingKey optimize_throw_if_noop = SettingKey.builder() .withName("optimize_throw_if_noop") .withType(SettingType.Bool) .withDescription("If setting is enabled and OPTIMIZE query didn't actually assign a merge then an explanatory exception is thrown") .build(); public static SettingKey use_index_for_in_with_subqueries = SettingKey.builder() .withName("use_index_for_in_with_subqueries") .withType(SettingType.Bool) .withDescription("Try using an index if there is a subquery or a table expression on the right side of the IN operator.") .build(); public static SettingKey empty_result_for_aggregation_by_empty_set = SettingKey.builder() .withName("empty_result_for_aggregation_by_empty_set") .withType(SettingType.Bool) .withDescription("Return empty result when aggregating without keys on empty set.") .build(); public static SettingKey allow_distributed_ddl = SettingKey.builder() .withName("allow_distributed_ddl") .withType(SettingType.Bool) .withDescription("If it is set to true, then a user is allowed to executed distributed DDL queries.") .build(); public static SettingKey odbc_max_field_size = SettingKey.builder() .withName("odbc_max_field_size") .withType(SettingType.Int64) .withDescription("Max size of filed can be read from ODBC dictionary. Long strings are truncated.") .build(); public static SettingKey max_rows_to_read = SettingKey.builder() .withName("max_rows_to_read") .withType(SettingType.Int64) .withDescription("Limit on read rows from the most 'deep' sources. That is, only in the deepest subquery. When reading from a remote server, it is only checked on a remote server.") .build(); public static SettingKey max_bytes_to_read = SettingKey.builder() .withName("max_bytes_to_read") .withType(SettingType.Int64) .withDescription("Limit on read bytes (after decompression) from the most 'deep' sources. That is, only in the deepest subquery. When reading from a remote server, it is only checked on a remote server.") .build(); public static SettingKey max_result_rows = SettingKey.builder() .withName("max_result_rows") .withType(SettingType.Int64) .withDescription("Limit on result size in rows. Also checked for intermediate data sent from remote servers.") .build(); public static SettingKey max_result_bytes = SettingKey.builder() .withName("max_result_bytes") .withType(SettingType.Int64) .withDescription("Limit on result size in bytes (uncompressed). Also checked for intermediate data sent from remote servers.") .build(); public static SettingKey result_overflow_mode = SettingKey.builder() .withName("result_overflow_mode") .withType(SettingType.UTF8) .withDescription("What to do when the limit is exceeded.") .build(); public static SettingKey min_execution_speed = SettingKey.builder() .withName("min_execution_speed") .withType(SettingType.Int64) .withDescription("In rows per second.") .build(); public static SettingKey timeout_before_checking_execution_speed = SettingKey.builder() .withName("timeout_before_checking_execution_speed") .withType(SettingType.Seconds) .withDescription("Check that the speed is not too low after the specified time has elapsed.") .build(); public static SettingKey max_ast_depth = SettingKey.builder() .withName("max_ast_depth") .withType(SettingType.Int64) .withDescription("Maximum depth of query syntax tree. Checked after parsing.") .build(); public static SettingKey max_ast_elements = SettingKey.builder() .withName("max_ast_elements") .withType(SettingType.Int64) .withDescription("Maximum size of query syntax tree in number of nodes. Checked after parsing.") .build(); public static SettingKey max_expanded_ast_elements = SettingKey.builder() .withName("max_expanded_ast_elements") .withType(SettingType.Int64) .withDescription("Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk.") .build(); public static SettingKey readonly = SettingKey.builder() .withName("readonly") .withType(SettingType.Int64) .withDescription("0 - everything is allowed. 1 - only read requests. 2 - only read requests, as well as changing settings, except for the 'readonly' setting.") .build(); public static SettingKey max_rows_in_set = SettingKey.builder() .withName("max_rows_in_set") .withType(SettingType.Int64) .withDescription("Maximum size of the set (in number of elements) resulting from the execution of the IN section.") .build(); public static SettingKey max_bytes_in_set = SettingKey.builder() .withName("max_bytes_in_set") .withType(SettingType.Int64) .withDescription("Maximum size of the set (in bytes in memory) resulting from the execution of the IN section.") .build(); public static SettingKey max_rows_in_join = SettingKey.builder() .withName("max_rows_in_join") .withType(SettingType.Int64) .withDescription("Maximum size of the hash table for JOIN (in number of rows).") .build(); public static SettingKey max_bytes_in_join = SettingKey.builder() .withName("max_bytes_in_join") .withType(SettingType.Int64) .withDescription("Maximum size of the hash table for JOIN (in number of bytes in memory).") .build(); public static SettingKey max_rows_to_transfer = SettingKey.builder() .withName("max_rows_to_transfer") .withType(SettingType.Int64) .withDescription("Maximum size (in rows) of the transmitted external table obtained when the GLOBAL IN/JOIN section is executed.") .build(); public static SettingKey max_bytes_to_transfer = SettingKey.builder() .withName("max_bytes_to_transfer") .withType(SettingType.Int64) .withDescription("Maximum size (in uncompressed bytes) of the transmitted external table obtained when the GLOBAL IN/JOIN section is executed.") .build(); public static SettingKey max_rows_in_distinct = SettingKey.builder() .withName("max_rows_in_distinct") .withType(SettingType.Int64) .withDescription("Maximum number of elements during execution of DISTINCT.") .build(); public static SettingKey max_bytes_in_distinct = SettingKey.builder() .withName("max_bytes_in_distinct") .withType(SettingType.Int64) .withDescription("Maximum total size of state (in uncompressed bytes) in memory for the execution of DISTINCT.") .build(); public static SettingKey max_memory_usage = SettingKey.builder() .withName("max_memory_usage") .withType(SettingType.Int64) .withDescription("Maximum memory usage for processing of single query. Zero means unlimited.") .build(); public static SettingKey max_memory_usage_for_user = SettingKey.builder() .withName("max_memory_usage_for_user") .withType(SettingType.Int64) .withDescription("Maximum memory usage for processing all concurrently running queries for the user. Zero means unlimited.") .build(); public static SettingKey max_memory_usage_for_all_queries = SettingKey.builder() .withName("max_memory_usage_for_all_queries") .withType(SettingType.Int64) .withDescription("Maximum memory usage for processing all concurrently running queries on the server. Zero means unlimited.") .build(); public static SettingKey max_network_bandwidth = SettingKey.builder() .withName("max_network_bandwidth") .withType(SettingType.Int64) .withDescription("The maximum speed of data exchange over the network in bytes per second for a query. Zero means unlimited.") .build(); public static SettingKey max_network_bytes = SettingKey.builder() .withName("max_network_bytes") .withType(SettingType.Int64) .withDescription("The maximum number of bytes (compressed) to receive or transmit over the network for execution of the query.") .build(); public static SettingKey max_network_bandwidth_for_user = SettingKey.builder() .withName("max_network_bandwidth_for_user") .withType(SettingType.Int64) .withDescription("The maximum speed of data exchange over the network in bytes per second for all concurrently running user queries. Zero means unlimited.") .build(); public static SettingKey max_network_bandwidth_for_all_users = SettingKey.builder() .withName("max_network_bandwidth_for_all_users") .withType(SettingType.Int64) .withDescription("The maximum speed of data exchange over the network in bytes per second for all concurrently running queries. Zero means unlimited.") .build(); public static SettingKey format_csv_delimiter = SettingKey.builder() .withName("format_csv_delimiter") .withType(SettingType.Char) .withDescription("The character to be considered as a delimiter in CSV data. If setting with a string, a string has to have a length of 1.") .build(); public static SettingKey enable_conditional_computation = SettingKey.builder() .withName("enable_conditional_computation") .withType(SettingType.Int64) .withDescription("Enable conditional computations") .build(); public static SettingKey allow_experimental_bigint_types = SettingKey.builder() .withName("allow_experimental_bigint_types") .withType(SettingType.Int64) .withDescription("Allow Int128, Int256, UInt256 and Decimal256 types") .build(); public static SettingKey client_name = SettingKey.builder() .withName("client_name") .withType(SettingType.UTF8) .withDescription("identify who you are, it will record in system.query_log") .build(); public static SettingKey port = SettingKey.builder() .withName("port") .withType(SettingType.Int32) .build(); public static SettingKey user = SettingKey.builder() .withName("user") .withType(SettingType.UTF8) .build(); public static SettingKey host = SettingKey.builder() .withName("host") .withType(SettingType.UTF8) .build(); public static SettingKey database = SettingKey.builder() .withName("database") .withType(SettingType.UTF8) .build(); public static SettingKey password = SettingKey.builder() .withName("password") .withType(SettingType.UTF8) .isSecret() .build(); public static SettingKey query_timeout = SettingKey.builder() .withName("query_timeout") .withType(SettingType.Seconds) .build(); public static SettingKey tcp_keep_alive = SettingKey.builder() .withName("tcp_keep_alive") .withType(SettingType.Bool) .build(); public static SettingKey charset = SettingKey.builder() .withName("charset") .withType(SettingType.UTF8) .withDescription("charset for converting between Bytes and String") .build(); public static SettingKey allow_experimental_map_type = SettingKey.builder() .withName("allow_experimental_map_type") .withType(SettingType.Int32) .withDescription("Allow Map field to be use") .build(); public static Builder builder() { return new Builder(); } public static Map<String, SettingKey> definedSettingKeys() { return new HashMap<>(DEFINED_SETTING_KEYS); } private final String name; private final SettingType<?> type; private final String description; private final Object defaultValue; private final boolean isSecret; private SettingKey(String name, SettingType<?> type, String description, Object defaultValue, boolean isSecret) { this.name = name; this.type = type; this.description = description; this.defaultValue = defaultValue; this.isSecret = isSecret; } public String name() { return name; } public String description() { return description; } public SettingType<?> type() { return type; } public Object defaultValue() { return defaultValue; } public boolean isSecret() { return isSecret; } public static class Builder { private String name; private SettingType<?> type; private String description; private Object defaultValue = null; private boolean isSecret = false; public Builder withName(String name) { this.name = name; return this; } public Builder withType(SettingType<?> type) { this.type = type; return this; } public Builder withDescription(String description) { this.description = description; return this; } public Builder withDefaultValue(Object defaultValue) { this.defaultValue = defaultValue; return this; } public Builder isSecret() { this.isSecret = true; return this; } public SettingKey build() { Validate.ensure(StrUtil.isNotBlank(name), "name must not blank"); Validate.ensure(Objects.nonNull(type), "type must not be null"); if (StrUtil.isBlank(description)) { description = name; } SettingKey settingKey = new SettingKey(name.toLowerCase(Locale.ROOT), type, description, defaultValue, isSecret); SettingKey.DEFINED_SETTING_KEYS.put(name, settingKey); return settingKey; } } }
50.106878
358
0.677451
e29253e377a857ca4c38558e878e7c41d667d84c
4,061
package org.fan.teat.security; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonTypeInfo.As; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.Inet4Address; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.OpenOption; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.Iterator; import java.util.stream.Collectors; import javax.servlet.ServletInputStream; import lombok.extern.slf4j.Slf4j; import org.fan.teat.security.config.security.component.SysAuthenticationToken; import org.fan.teat.security.config.security.component.SysUserDetail; import org.fan.teat.security.utils.JsonUtil; import org.fan.teat.security.utils.RedisUtil; import org.fan.teat.security.utils.SnowFlakeUtil; import org.junit.jupiter.api.Test; import redis.clients.jedis.Jedis; /** * 测试工具类的功能 * * @version 1.0 * @author: Fan * @date 2020.10.26 15:00 */ @Slf4j public class TestUtils { private static final ObjectMapper mapper = new ObjectMapper(); static { mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); //mapper.activateDefaultTyping(mapper.getPolymorphicTypeValidator(), DefaultTyping.NON_FINAL, As.PROPERTY); } @Test public void TestSnowFlake() { for (int i = 0; i < 500; i++) { log.info("[TestUtils.TestSnowFlake] id = {}", SnowFlakeUtil.nextId()); } } @Test public void testJson() { Person person = new Person("name", "address"); try { String value = mapper.writeValueAsString(person); System.out.println(value); JsonNode jsonNode = mapper.readValue(value, JsonNode.class); System.out.println(jsonNode.fieldNames()); } catch (JsonProcessingException e) { e.printStackTrace(); } } @Test public void testClassName() { System.out.println(this.getClass().getName()); } @Test public void testStream() { try (InputStream inputStream = Files .newInputStream(Paths.get("F:\\test\\test_doc\\test.txt"), StandardOpenOption.READ); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { long start = System.currentTimeMillis(); String reduce = reader.lines().collect(Collectors.joining("\n")); long end = System.currentTimeMillis(); log.info("[TestUtils.testStream] lines is\n{}\ncost time is {}", reduce, (end - start)); } catch (Exception e) { log.error("[TestUtils.testStream]", e); } } @Test public void testRedis(){ String str = RedisUtil.getInstance().get("session_375ce598-34e0-47cb-adeb-21179dd50da1"); SysAuthenticationToken token = JsonUtil.fromJson(str, SysAuthenticationToken.class); System.out.println(token); } @Test public void testMath(){ System.out.println((float) 1 / 100); } static class Person { private String name; private String address; public Person() { } public Person(String name, String address) { this.name = name; this.address = address; } public String getName() { return name; } public Person setName(String name) { this.name = name; return this; } public String getAddress() { return address; } public Person setAddress(String address) { this.address = address; return this; } @Override public String toString() { return "Person{" + "name='" + name + '\'' + ", address='" + address + '\'' + '}'; } } }
27.62585
113
0.703521
f84035a6f3f46b946ce8289c6d44e9e88534d14c
1,881
/* * 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.isis.applib.spec; /** * Adapter to make it easy to perform boolean algebra on {@link Specification}s. * * <p> * <p> * Subclasses represent the logical inverse of a {@link Specification}s. An * implementation should instantiate the {@link Specification}s to be satisfied * in its constructor. * * <p> * For example: * * <pre> * public class NoSugarThanksSpec extends SpecificationNot { * public NoSugarThanksSpec() { * super( * new TwoLumpsOfSugarSpec(), * ); * } * } * </pre> * * @see SpecificationAnd * @see SpecificationOr * @since 1.x {@index} */ public abstract class SpecificationNot implements Specification { private final Specification specification; public SpecificationNot(final Specification specification) { this.specification = specification; } @Override public String satisfies(final Object obj) { final String satisfies = specification.satisfies(obj); return satisfies != null ? null : "not satisfied"; } }
30.33871
80
0.696438
668e0357e723252b9dacd140661d8dd91ba5b586
344
package com.convious.pricingapi.events; public class ProductRemoved implements InventoryEvent { private final String productReference; public ProductRemoved(String productReference) { this.productReference = productReference; } public String productReference() { return productReference; } }
24.571429
56
0.712209
3d47ab9b99b42fe4740a1016702953c605be7952
1,209
package io.rheem.flink.plugin; import io.rheem.core.api.Configuration; import io.rheem.core.mapping.Mapping; import io.rheem.core.optimizer.channels.ChannelConversion; import io.rheem.core.platform.Platform; import io.rheem.core.plugin.Plugin; import io.rheem.flink.channels.ChannelConversions; import io.rheem.flink.platform.FlinkPlatform; import io.rheem.java.platform.JavaPlatform; import java.util.Arrays; import java.util.Collection; import java.util.Collections; /** * This {@link Plugin} provides {@link ChannelConversion}s from the {@link FlinkPlatform}. */ public class FlinkConversionPlugin implements Plugin { @Override public Collection<Mapping> getMappings() { return Collections.emptyList(); } @Override public Collection<ChannelConversion> getChannelConversions() { return ChannelConversions.ALL; } @Override public Collection<Platform> getRequiredPlatforms() { return Arrays.asList(FlinkPlatform.getInstance(), JavaPlatform.getInstance()); } @Override public void setProperties(Configuration configuration) { // Nothing to do, because we already configured the properties in #configureDefaults(...). } }
30.225
98
0.750207
226d2f1f055e58b02bd4d1d0cd6257d80c5dd8b9
486
public class Person { private String name; private String number; public Person(String name, String number) { this.name = name; this.number = number; } public String getName() { return name; } public String getNumber() { return number; } public void changeNumber(String number) { this.number = number; } @Override public String toString() { return name + " number: " + number; } }
18
47
0.569959
5bebc32a2ff89ba93679262166c99ad86ad4e7cf
15,613
/* Copyright 2004-2019 Jim Voris * * 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.qumasoft.guitools.qwin.operation; import com.qumasoft.guitools.qwin.FileTableModel; import com.qumasoft.guitools.qwin.ParentProgressDialogInterface; import com.qumasoft.guitools.qwin.ProgressDialogInterface; import com.qumasoft.guitools.qwin.QWinFrame; import static com.qumasoft.guitools.qwin.QWinUtility.logProblem; import static com.qumasoft.guitools.qwin.QWinUtility.warnProblem; import com.qumasoft.guitools.qwin.dialog.ParentChildProgressDialog; import com.qumasoft.guitools.qwin.dialog.ProgressDialog; import com.qumasoft.qvcslib.ArchiveDirManagerProxy; import com.qumasoft.qvcslib.KeywordExpansionContext; import com.qumasoft.qvcslib.KeywordManagerFactory; import com.qumasoft.qvcslib.MergedInfoInterface; import com.qumasoft.qvcslib.QVCSException; import com.qumasoft.qvcslib.UserLocationProperties; import com.qumasoft.qvcslib.Utility; import com.qumasoft.qvcslib.WorkFile; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import javax.swing.JTable; import javax.swing.SwingUtilities; /** * Operation base class. * @author Jim Voris */ public abstract class OperationBaseClass { static final int MINIMUM_TO_SHOW_PROGRESS = 10; private final JTable fileTable; private final String serverName; private final String projectName; private final String branchName; private final UserLocationProperties userLocationProperties; // KLUDGE -- use this to store the progress dialog that we create on the Swing thread. private static ProgressDialog staticProgressDialog; private static ParentChildProgressDialog staticParentChildProgressDialog; private boolean workCompletedFlag; /** * Creates a new instance of OperationBaseClass. * * @param ft the file table. * @param server name of the server * @param project name of the project. * @param branch name of the branch. * @param userLocationProps user location properties. */ public OperationBaseClass(JTable ft, final String server, final String project, final String branch, UserLocationProperties userLocationProps) { fileTable = ft; serverName = server; projectName = project; branchName = branch; userLocationProperties = userLocationProps; workCompletedFlag = false; } /** * Perform the operation. */ public abstract void executeOperation(); // Return an ArrayList of MergedInfo objects that are associated with // the selected files. protected List<MergedInfoInterface> getSelectedFiles() { int[] selectedRows = getFileTable().getSelectedRows(); FileTableModel dataModel = (FileTableModel) getFileTable().getModel(); List<MergedInfoInterface> mergedInfoArray = new ArrayList<>(); // Create a list of the selected files. for (int i = 0; i < selectedRows.length; i++) { // Save the names of the archives we'll work on. int selectedRowIndex = selectedRows[i]; MergedInfoInterface mergedInfo = dataModel.getMergedInfo(selectedRowIndex); mergedInfoArray.add(mergedInfo); } return mergedInfoArray; } protected int getSelectedFileCount() { int retVal = 0; if (getFileTable() != null) { retVal = getFileTable().getSelectedRowCount(); } return retVal; } protected MergedInfoInterface getFocusedFile() { MergedInfoInterface mergedInfo = null; if (getSelectedFileCount() > 0) { int focusIndex = QWinFrame.getQWinFrame().getRightFilePane().getFocusIndex(); if (focusIndex >= 0) { FileTableModel dataModel = (FileTableModel) getFileTable().getModel(); mergedInfo = dataModel.getMergedInfo(focusIndex); } } return mergedInfo; } protected JTable getFileTable() { return fileTable; } protected String getServerName() { return serverName; } protected String getProjectName() { return projectName; } protected String getBranchName() { return branchName; } protected boolean createWorkfileDirectory(MergedInfoInterface mergedInfo) { boolean retVal = false; String workfileBase = getUserLocationProperties().getWorkfileLocation(getServerName(), getProjectName(), getBranchName()); String fullWorkfileDirectory = workfileBase + File.separator + mergedInfo.getArchiveDirManager().getAppendedPath(); File workfileFile = new File(fullWorkfileDirectory); if (!workfileFile.exists()) { if (!workfileFile.mkdirs()) { logProblem("Could not create workfile directory: " + fullWorkfileDirectory); } else { retVal = true; } } else { retVal = true; } return retVal; } protected UserLocationProperties getUserLocationProperties() { return userLocationProperties; } /** * Create a progress dialog. * @param progressAction what we're doing. * @param size the maximum progress value. * @return the created ProgressDialog. */ public static ProgressDialog createProgressDialog(final String progressAction, final int size) { ProgressDialog progressMonitor = null; if (SwingUtilities.isEventDispatchThread()) { // Create a progress dialog. progressMonitor = new ProgressDialog(QWinFrame.getQWinFrame(), true, 0, size); progressMonitor.setAction(progressAction); } else { Runnable create = () -> { // Create a progress dialog. staticProgressDialog = new ProgressDialog(QWinFrame.getQWinFrame(), true, 0, size); staticProgressDialog.setAction(progressAction); }; try { SwingUtilities.invokeAndWait(create); progressMonitor = staticProgressDialog; } catch (InvocationTargetException e) { warnProblem("Caught InvocationTargetException: " + e.getClass().toString() + " : " + e.getLocalizedMessage()); } catch (InterruptedException ie) { warnProblem("Caught InterruptedException: " + ie.getClass().toString() + " : " + ie.getLocalizedMessage()); Thread.currentThread().interrupt(); } } return progressMonitor; } /** * Initialize the given progress dialog. * @param action to say what is going on. * @param min the minimum value for the progress bar. * @param max the maximum value for the progress bar. * @param progressDialog the progress dialog to be initialized. */ public static void initProgressDialog(final String action, final int min, final int max, final ProgressDialogInterface progressDialog) { // Update the progress monitor Runnable later = () -> { progressDialog.initProgressBar(min, max); progressDialog.setAction(action); }; javax.swing.SwingUtilities.invokeLater(later); } /** * Update the given progress dialog. * @param progress how far along we are. * @param activity what we're doing. * @param progressDialog the progress dialog to update. */ public static void updateProgressDialog(final int progress, final String activity, final ProgressDialogInterface progressDialog) { // Update the progress monitor Runnable later = () -> { if ((progress > MINIMUM_TO_SHOW_PROGRESS) && !progressDialog.getProgressDialogVisibleFlag()) { progressDialog.setVisible(true); progressDialog.setProgressDialogVisibleFlag(true); } progressDialog.setProgress(progress); progressDialog.setActivity(activity); }; javax.swing.SwingUtilities.invokeLater(later); } /** * Create a parent-child progress dialog. * @param progressAction the action to show. * @param size the maximum value for the parent's progress bar. * @return a parent-child progress dialog. */ public static ParentChildProgressDialog createParentProgressDialog(final String progressAction, final int size) { ParentChildProgressDialog progressMonitor = null; if (SwingUtilities.isEventDispatchThread()) { // Create a progress dialog. progressMonitor = new ParentChildProgressDialog(QWinFrame.getQWinFrame(), true, 0, size); progressMonitor.setParentAction(progressAction); } else { Runnable create = () -> { // Create a progress dialog. staticParentChildProgressDialog = new ParentChildProgressDialog(QWinFrame.getQWinFrame(), true, 0, size); staticParentChildProgressDialog.setParentAction(progressAction); }; try { SwingUtilities.invokeAndWait(create); progressMonitor = staticParentChildProgressDialog; } catch (InvocationTargetException e) { warnProblem("Caught InvocationTargetException: " + e.getClass().toString() + " : " + e.getLocalizedMessage()); } catch (InterruptedException ie) { warnProblem("Caught InterruptedException: " + ie.getClass().toString() + " : " + ie.getLocalizedMessage()); Thread.currentThread().interrupt(); } } return progressMonitor; } static void initParentChildProgressDialog(final String action, final int min, final int max, final ParentProgressDialogInterface progressDialog) { // Update the progress monitor Runnable later = () -> { progressDialog.initParentProgressBar(min, max); progressDialog.setParentAction(action); }; javax.swing.SwingUtilities.invokeLater(later); } /** * Update a parent-child progress dialog. * @param i the parent progress. * @param activity what is happening. * @param progressDialog the dialog that we are to update. */ public static void updateParentChildProgressDialog(final int i, final String activity, final ParentProgressDialogInterface progressDialog) { // Update the progress monitor Runnable later = () -> { progressDialog.setParentProgress(i); progressDialog.setParentActivity(activity); }; javax.swing.SwingUtilities.invokeLater(later); } protected void writeMergedResultToWorkfile(MergedInfoInterface mergedInfo, String workfileBase, byte[] buffer) { java.io.FileOutputStream outputStream = null; ArchiveDirManagerProxy dirManagerProxy; try { String fullWorkfileName = constructFullWorkfileName(mergedInfo, workfileBase); WorkFile workfile = new WorkFile(fullWorkfileName); if (!mergedInfo.getWorkfileExists()) { createWorkfileDirectory(mergedInfo); } if (workfile.exists()) { workfile.setReadWrite(); } // Figure out our directory manager. dirManagerProxy = (ArchiveDirManagerProxy) mergedInfo.getArchiveDirManager(); // See if we have to worry about keyword expansion... if (mergedInfo.getKeywordExpansionAttribute() && dirManagerProxy != null) { try { outputStream = new java.io.FileOutputStream(workfile); KeywordExpansionContext keywordExpansionContext = new KeywordExpansionContext(outputStream, workfile, mergedInfo.getLogfileInfo(), mergedInfo.getLogfileInfo().getRevisionInformation().getRevisionIndex(mergedInfo.getDefaultRevisionString()), "", dirManagerProxy.getAppendedPath(), dirManagerProxy.getProjectProperties()); KeywordManagerFactory.getInstance().getKeywordManager().expandKeywords(buffer, keywordExpansionContext); } catch (QVCSException e) { warnProblem(Utility.expandStackTraceToString(e)); } finally { if (outputStream != null) { outputStream.close(); } } } else { try { outputStream = new java.io.FileOutputStream(workfile); Utility.writeDataToStream(buffer, outputStream); } finally { if (outputStream != null) { outputStream.close(); } } } } catch (java.io.IOException e) { warnProblem(Utility.expandStackTraceToString(e)); } } protected void writeConflictFile(MergedInfoInterface mergedInfo, String conflictFileType, String workfileBase, byte[] buffer) { java.io.FileOutputStream outputStream = null; try { String fileExtension = Utility.getFileExtension(mergedInfo.getShortWorkfileName()); String fullWorkfileName = constructFullWorkfileName(mergedInfo, workfileBase); int indexOfExtension = fullWorkfileName.lastIndexOf("."); String constructedFileName = fullWorkfileName.substring(0, indexOfExtension) + "." + conflictFileType + "." + fileExtension; WorkFile workfile = new WorkFile(constructedFileName); if (!mergedInfo.getWorkfileExists()) { createWorkfileDirectory(mergedInfo); } if (workfile.exists()) { workfile.setReadWrite(); } try { outputStream = new java.io.FileOutputStream(workfile); Utility.writeDataToStream(buffer, outputStream); } finally { if (outputStream != null) { outputStream.close(); } } } catch (java.io.IOException e) { warnProblem(Utility.expandStackTraceToString(e)); } } private String constructFullWorkfileName(MergedInfoInterface mergedInfo, String workfileBase) { String fullWorkfileName = workfileBase + File.separator + mergedInfo.getArchiveDirManager().getAppendedPath() + File.separator + mergedInfo.getShortWorkfileName(); return fullWorkfileName; } /** * Is the operation complete. * * @return true if the operation has completed; false if it has not completed. */ public boolean isWorkCompleted() { return this.workCompletedFlag; } /** * Used by child classes to indicate that they have finished their work. */ protected void setWorkCompleted() { this.workCompletedFlag = true; } }
40.765013
171
0.64536
0a204f84bd9f370525f49ed38416e0efa28d125d
1,959
package org.zstack.header.network.l3; import org.springframework.http.HttpMethod; import org.zstack.header.identity.Action; import org.zstack.header.message.APIEvent; import org.zstack.header.message.APIMessage; import org.zstack.header.message.APIParam; import org.zstack.header.notification.ApiNotification; import org.zstack.header.rest.RestRequest; /** */ @Action(category = L3NetworkConstant.ACTION_CATEGORY) @RestRequest( path = "/l3-networks/{l3NetworkUuid}/hostroute", method = HttpMethod.DELETE, responseClass = APIRemoveHostRouteFromL3NetworkEvent.class ) public class APIRemoveHostRouteFromL3NetworkMsg extends APIMessage implements L3NetworkMessage { /** * @desc l3Network uuid */ @APIParam(resourceType = L3NetworkVO.class, checkAccount = true, operationTarget = true) private String l3NetworkUuid; /** * @desc ip prefix */ @APIParam private String prefix; @Override public String getL3NetworkUuid() { return l3NetworkUuid; } public void setL3NetworkUuid(String l3NetworkUuid) { this.l3NetworkUuid = l3NetworkUuid; } public String getPrefix() { return prefix; } public void setPrefix(String prefix) { this.prefix = prefix; } public static APIRemoveHostRouteFromL3NetworkMsg __example__() { APIRemoveHostRouteFromL3NetworkMsg msg = new APIRemoveHostRouteFromL3NetworkMsg(); msg.setL3NetworkUuid(uuid()); msg.setPrefix("169.254.169.254/32"); return msg; } public ApiNotification __notification__() { APIMessage that = this; return new ApiNotification() { @Override public void after(APIEvent evt) { ntfy("Removed a hostroute prefix [%s]", prefix).resource(l3NetworkUuid, L3NetworkVO.class.getSimpleName()) .messageAndEvent(that, evt).done(); } }; } }
27.985714
122
0.678918
0d6a9f3409df49b1c0b2ec8dba8388c92bb0ece6
650
package com.lyh.flowers.service; import java.util.List; import com.lyh.flowers.pojo.Order; import com.lyh.flowers.pojo.OrderItem; import com.lyh.flowers.pojo.PageBean; public interface IOrderService { public PageBean<Order> myOrders(String uid, int pc); public PageBean<Order> findAll(int pc); public Order load(String oid); public void createOrder(Order order); public void addOrderItem(List<OrderItem> orderItems); public int findStatus(String oid); public PageBean<Order> findByStatus(int status,int pc); public void updateStatus(String oid, int status); public void updatStatusByItem(String orderItemId,String status); }
23.214286
65
0.776923
072dc412f23346371a00d52403d165a42ce77c16
894
package net.minecraft.server; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; // CraftBukkit public class Packet3Chat extends Packet { public String message; public Packet3Chat() {} public Packet3Chat(String s) { /* CraftBukkit start - handle this later if (s.length() > 119) { s = s.substring(0, 119); } // CraftBukkit end */ this.message = s; } public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit this.message = a(datainputstream, 119); } public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit a(this.message, dataoutputstream); } public void a(NetHandler nethandler) { nethandler.a(this); } public int a() { return this.message.length(); } }
22.35
88
0.637584
c940d9e1c27c7931d20d8fe6226c2856fb4c635d
8,814
/* * Copyright (c) 2017, salesforce.com, inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided * that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or * promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package com.sforce.ws.bind; import com.sforce.ws.ConnectionException; import com.sforce.ws.parser.PullParserException; import com.sforce.ws.parser.XmlInputStream; import com.sforce.ws.types.OffsetDate; import com.sforce.ws.wsdl.Constants; import org.junit.Test; import javax.xml.namespace.QName; import java.io.ByteArrayInputStream; import java.io.IOException; import java.time.*; import static org.junit.Assert.assertEquals; /** * This test validates type mapper functionality * * @author rcornel */ public class TypeMapperTests { // test to validate we can read primitive int array types. @Test public void testPrimitiveArrayRead() throws PullParserException, ConnectionException, IOException { String arrayStr = "<b><a>0</a><a>1</a><a>2</a></b>"; ByteArrayInputStream inputStream = new ByteArrayInputStream(arrayStr.getBytes()); XmlInputStream xmlInputStream = new XmlInputStream(); xmlInputStream.setInput(inputStream, "UTF-8"); xmlInputStream.nextTag(); TypeInfo info = new TypeInfo("", "a", "", "int", 0, 5, true); TypeMapper mapper = new TypeMapper(null, null, false); int[] returnArray = (int[]) mapper.readPartialArray(xmlInputStream, info, int[].class); for (int i = 0; i < returnArray.length; i++) { assertEquals(i, returnArray[i]); } } // test to validate we can read a String Array type @Test public void testStringArrayRead() throws PullParserException, ConnectionException, IOException { String arrayStr = "<b><a>Test</a></b>"; ByteArrayInputStream inputStream = new ByteArrayInputStream(arrayStr.getBytes()); XmlInputStream xmlInputStream = new XmlInputStream(); xmlInputStream.setInput(inputStream, "UTF-8"); xmlInputStream.nextTag(); TypeInfo info = new TypeInfo("", "a", "", "int", 0, 5, true); TypeMapper mapper = new TypeMapper(null, null, false); String[] returnArray = (String[]) mapper.readPartialArray(xmlInputStream, info, String[].class); assertEquals("Test", returnArray[0]); } @Test public void testDateRead() throws PullParserException, IOException, ConnectionException { String withoutTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:date>2019-12-02</xsd:date></xml>"; String withTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:date>2019-12-02+05:00</xsd:date></xml>"; XmlInputStream xmlWithoutTimeZone = new XmlInputStream(); xmlWithoutTimeZone.setInput(new ByteArrayInputStream(withoutTimeZone.getBytes()), "UTF-8"); xmlWithoutTimeZone.nextTag(); XmlInputStream xmlWithTimeZone = new XmlInputStream(); xmlWithTimeZone.setInput(new ByteArrayInputStream(withTimeZone.getBytes()), "UTF-8"); xmlWithTimeZone.nextTag(); TypeInfo info = new TypeInfo("", "a", Constants.SCHEMA_NS, "date", 0, 1, true); TypeMapper mapper = new TypeMapper(null, null, true); String javaClassName = mapper.getJavaClassName(new QName(Constants.SCHEMA_NS, "date"), null, false); assertEquals(OffsetDate.class.getName(), javaClassName); OffsetDate result1 = (OffsetDate) mapper.readObject(xmlWithoutTimeZone, info, OffsetDate.class); assertEquals(ZoneOffset.UTC, result1.getOffset()); assertEquals(LocalDate.of(2019, 12, 2), result1.getDate()); OffsetDate result2 = (OffsetDate) mapper.readObject(xmlWithTimeZone, info, OffsetDate.class); assertEquals(ZoneOffset.of("+05:00"), result2.getOffset()); assertEquals(LocalDate.of(2019, 12, 2), result2.getDate()); } @Test public void testDateTimeRead() throws PullParserException, IOException, ConnectionException { String withoutTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:datetime>2019-12-02T11:22:33.444</xsd:datetime></xml>"; String withTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:datetime>2019-12-02T11:22:33.444-05:00</xsd:datetime></xml>"; XmlInputStream xmlWithoutTimeZone = new XmlInputStream(); xmlWithoutTimeZone.setInput(new ByteArrayInputStream(withoutTimeZone.getBytes()), "UTF-8"); xmlWithoutTimeZone.nextTag(); XmlInputStream xmlWithTimeZone = new XmlInputStream(); xmlWithTimeZone.setInput(new ByteArrayInputStream(withTimeZone.getBytes()), "UTF-8"); xmlWithTimeZone.nextTag(); TypeInfo info = new TypeInfo("", "a", Constants.SCHEMA_NS, "dateTime", 0, 1, true); TypeMapper mapper = new TypeMapper(null, null, true); String javaClassName = mapper.getJavaClassName(new QName(Constants.SCHEMA_NS, "dateTime"), null, false); assertEquals(OffsetDateTime.class.getName(), javaClassName); OffsetDateTime result1 = (OffsetDateTime) mapper.readObject(xmlWithoutTimeZone, info, OffsetDateTime.class); assertEquals(ZoneOffset.UTC, result1.getOffset()); assertEquals(LocalDateTime.of(2019, 12, 2, 11, 22, 33, 444000000), result1.toLocalDateTime()); OffsetDateTime result2 = (OffsetDateTime) mapper.readObject(xmlWithTimeZone, info, OffsetDateTime.class); assertEquals(ZoneOffset.of("-05:00"), result2.getOffset()); assertEquals(LocalDateTime.of(2019, 12, 2, 11, 22, 33, 444000000), result2.toLocalDateTime()); } @Test public void testTimeRead() throws PullParserException, IOException, ConnectionException { String withoutTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:time>11:22:33.444</xsd:time></xml>"; String withTimeZone = "<xml xmlns=\"http://schemas.xmlsoap.org/wsdl\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><xsd:time>11:22:33.444+05:00</xsd:time></xml>"; XmlInputStream xmlWithoutTimeZone = new XmlInputStream(); xmlWithoutTimeZone.setInput(new ByteArrayInputStream(withoutTimeZone.getBytes()), "UTF-8"); xmlWithoutTimeZone.nextTag(); XmlInputStream xmlWithTimeZone = new XmlInputStream(); xmlWithTimeZone.setInput(new ByteArrayInputStream(withTimeZone.getBytes()), "UTF-8"); xmlWithTimeZone.nextTag(); TypeInfo info = new TypeInfo("", "a", Constants.SCHEMA_NS, "time", 0, 1, true); TypeMapper mapper = new TypeMapper(null, null, true); String javaClassName = mapper.getJavaClassName(new QName(Constants.SCHEMA_NS, "time"), null, false); assertEquals(OffsetTime.class.getName(), javaClassName); OffsetTime result1 = (OffsetTime) mapper.readObject(xmlWithoutTimeZone, info, OffsetTime.class); assertEquals(ZoneOffset.UTC, result1.getOffset()); assertEquals(LocalTime.of(11, 22, 33, 444000000), result1.toLocalTime()); OffsetTime result2 = (OffsetTime) mapper.readObject(xmlWithTimeZone, info, OffsetTime.class); assertEquals(ZoneOffset.of("+05:00"), result2.getOffset()); assertEquals(LocalTime.of(11, 22, 33, 444000000), result2.toLocalTime()); } }
51.54386
191
0.709666
8d9104dbe148820b661b8c549346a2ab5de237e1
6,444
/* Derby - Class org.apache.derbyDemo.vtis.core.FlatFileVTI 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.derbyDemo.vtis.core; import java.io.*; import java.math.BigDecimal; import java.sql.*; import java.text.DateFormat; import java.text.ParseException; /** * <p> * This VTI makes a table out of the records in a flat file. This is an abstract * class. Child classes are responsible for implementing the following methods * which parse and advance the file: * </p> * * <ul> * <li>parseRow() - Parses the next record of the file into an array of Strings, * one for each column.</li> * </ul> */ public abstract class FlatFileVTI extends StringColumnVTI { /////////////////////////////////////////////////////////////////////////////////// // // CONSTANTS // /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// // // STATE // /////////////////////////////////////////////////////////////////////////////////// private String _textFileName; private File _file; private FileReader _fileReader; private LineNumberReader _lineReader; private boolean _closed = false; private String[] _row; private int _lineNumber = -1; /////////////////////////////////////////////////////////////////////////////////// // // FlatFileVTI BEHAVIOR TO BE IMPLEMENTED BY SUBCLASSES // /////////////////////////////////////////////////////////////////////////////////// /** * <p> * Parse the next chunk of text, using readLine(), and return the next row. * Returns null if the file is exhausted. * </p> */ protected abstract String[] parseRow( ) throws SQLException; /////////////////////////////////////////////////////////////////////////////////// // // StringColumnVTI BEHAVIOR TO BE IMPLEMENTED BY SUBCLASSES // /////////////////////////////////////////////////////////////////////////////////// /** * <p> * Get the string value of the column in the current row identified by the 1-based columnNumber. * </p> */ protected String getRawColumn( int columnNumber ) throws SQLException { return _row[ columnNumber - 1 ]; } /////////////////////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////////////////////// /** * <p> * Build a StringColumnVTI with the given column names * </p> */ public FlatFileVTI( String[] columnNames, String textFileName ) { super( columnNames ); _textFileName = textFileName; } /////////////////////////////////////////////////////////////////////////////////// // // ResultSet BEHAVIOR // /////////////////////////////////////////////////////////////////////////////////// public boolean next() throws SQLException { if ( _file == null ) { try { _file = new File( _textFileName ); _fileReader = new FileReader( _file ); _lineReader = new LineNumberReader( _fileReader ); } catch (Throwable t) { throw wrap( t ); } } _row = parseRow(); if ( _row == null ) { return false; } else { return true; } } public void close() throws SQLException { try { if ( _lineReader != null ) { _lineReader.close(); } if ( _fileReader != null ) { _fileReader.close(); } } catch (Throwable t) { throw wrap( t ); } finally { _lineReader = null; _fileReader = null; _file = null; } } public ResultSetMetaData getMetaData() throws SQLException { throw new SQLException( "Not implemented." ); } /////////////////////////////////////////////////////////////////////////////////// // // MINIONS // /////////////////////////////////////////////////////////////////////////////////// /** * <p> * Get the current line number. * </p> */ protected int getLineNumber() { return _lineNumber; } /** * <p> * Get the name of the file being read. * </p> */ protected String getTextFileName() { return _textFileName; } /** * <p> * Read the next line from the file and return it. Return null if the file * is exhausted. * </p> */ protected String readLine() throws SQLException { try { String retval = _lineReader.readLine(); _lineNumber++; return retval; } catch( Throwable t ) { throw wrap( t ); } } /** * <p> * Wrap an exception in a SQLException. * </p> */ protected SQLException wrap( Throwable t ) { SQLException se = new SQLException( t.getMessage() ); se.initCause( t ); return se; } /** * <p> * Wrap an exception in a SQLException. * </p> */ protected SQLException wrap( String message, Throwable t ) { SQLException se = new SQLException( message ); se.initCause( t ); return se; } }
28.767857
101
0.450341
7f254232a5745e0e357f48123fb067536b316d3d
3,770
package testCustomAnalyzer.typesystem; /*Generated by MPS */ import jetbrains.mps.lang.typesystem.runtime.AbstractNonTypesystemRule_Runtime; import jetbrains.mps.lang.typesystem.runtime.NonTypesystemRule_Runtime; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.typesystem.inference.TypeCheckingContext; import jetbrains.mps.lang.typesystem.runtime.IsApplicableStatus; import jetbrains.mps.analyzers.runtime.framework.CustomAnalyzerRunner; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import testCustomAnalyzer.dataFlow.CustomAnalyzerWithModeAnalyzerRunner; import jetbrains.mps.lang.dataFlow.MPSProgramFactory; import java.util.Arrays; import jetbrains.mps.lang.dataFlow.framework.IDataFlowModeId; import jetbrains.mps.lang.dataFlow.framework.ConceptDataFlowModeId; import jetbrains.mps.lang.dataFlow.framework.AnalysisResult; import java.util.List; import jetbrains.mps.lang.dataFlow.framework.instructions.Instruction; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.errors.messageTargets.MessageTarget; import jetbrains.mps.errors.messageTargets.NodeMessageTarget; import jetbrains.mps.errors.IErrorReporter; import org.jetbrains.mps.openapi.language.SAbstractConcept; import org.jetbrains.mps.openapi.language.SProperty; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.mps.openapi.language.SConcept; public class check_ParentCounter_NonTypesystemRule extends AbstractNonTypesystemRule_Runtime implements NonTypesystemRule_Runtime { public check_ParentCounter_NonTypesystemRule() { } public void applyRule(final SNode root, final TypeCheckingContext typeCheckingContext, IsApplicableStatus status) { CustomAnalyzerRunner<Integer> runner; if (SPropertyOperations.getInteger(root, PROPS.maxChildCount$XMZl) < 10) { runner = new CustomAnalyzerWithModeAnalyzerRunner(root); } else { runner = new CustomAnalyzerWithModeAnalyzerRunner(root, new MPSProgramFactory(Arrays.<IDataFlowModeId>asList(new ConceptDataFlowModeId("jetbrains.mps.lang.dataFlow.structure.IntraProcedural_BuilderMode")))); } AnalysisResult<Integer> result = runner.analyze(); List<Instruction> instructions = runner.getProgram().getInstructions(); for (Instruction instruction : ListSequence.fromList(instructions)) { Integer resultCounter = result.get(instruction); SNode source = ((SNode) instruction.getSource()); if (resultCounter > SPropertyOperations.getInteger(root, PROPS.maxChildCount$XMZl) && source != null) { { final MessageTarget errorTarget = new NodeMessageTarget(); IErrorReporter _reporter_2309309498 = typeCheckingContext.reportTypeError(root, "child counter > " + SPropertyOperations.getInteger(root, PROPS.maxChildCount$XMZl), "r:6ac8df16-203b-470e-8af3-57784a2fb1f4(testCustomAnalyzer.typesystem)", "2955426575106086783", null, errorTarget); } break; } } } public SAbstractConcept getApplicableConcept() { return CONCEPTS.Root$7R; } public IsApplicableStatus isApplicableAndPattern(SNode argument) { return new IsApplicableStatus(argument.getConcept().isSubConceptOf(getApplicableConcept()), null); } public boolean overrides() { return false; } private static final class PROPS { /*package*/ static final SProperty maxChildCount$XMZl = MetaAdapterFactory.getProperty(0xb124c25e1e164432L, 0xad5e0ac0ecae98f5L, 0x73a316f7f5468ed4L, 0x73a316f7f548c73dL, "maxChildCount"); } private static final class CONCEPTS { /*package*/ static final SConcept Root$7R = MetaAdapterFactory.getConcept(0xb124c25e1e164432L, 0xad5e0ac0ecae98f5L, 0x73a316f7f5468ed4L, "testCustomAnalyzer.structure.Root"); } }
53.098592
290
0.807692
e170631d7435072b4475d389dc0187e938b9dad2
1,031
package powerapi.entity; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.annotations.TableId; import com.baomidou.mybatisplus.enums.IdType; import powerapi.common.utils.DateFormatUtil; import java.util.Date; /** * Created by Melon on 17/3/2. */ public class BaseEntity { @TableId(type = IdType.AUTO) protected Long id; protected String createdate; @TableField(exist = false) protected String logResource; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCreatedate() { return createdate; } public void setCreatedate(String createdate) { this.createdate = createdate; } public String getLogResource() { return logResource; } public void setLogResource(String logResource) { this.logResource = logResource; } public String getRelativedate() { return DateFormatUtil.getRelativeDate(createdate); } }
20.215686
58
0.677013
d85ee9b694ef7ba1833a535330c4c66a93c0d181
1,844
package com.azureip.ipspider.service; import com.azureip.ipspider.mapper.ProxyIPMapper; import com.azureip.ipspider.model.ProxyIP; import com.azureip.ipspider.task.ProxyIPVerifyTask; import org.apache.http.HttpStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; /** * 代理IP验证服务类 * @author LewisZhang * 6th.Dec.2019 */ @Service public class ProxyIPVerifyService { private static final Logger LOG = LogManager.getLogger(ProxyIPVerifyService.class); @Autowired(required = false) private ProxyIPMapper proxyIPMapper; @Autowired private ProxyIPVerifyTask proxyIPVerifyTask; /** * 代理IP验证 * @param payload 负载 * @param threads 线程数 */ public void verifyProxyIP(Integer payload, Integer threads) { // 提取IP Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.HOUR, -6); Date deadline = calendar.getTime(); List<ProxyIP> pendingProxies = proxyIPMapper.selectUnverifiedProxies(deadline, payload * threads); LOG.debug("查询到的列表大小为:" + pendingProxies.size()); List<ProxyIP> tmpList = new ArrayList<>(); pendingProxies.forEach(p -> { tmpList.add(p); if (tmpList.size() >= payload) { proxyIPVerifyTask.verifyProxies(new ArrayList<>(tmpList)); tmpList.clear(); } }); if (!tmpList.isEmpty()) { proxyIPVerifyTask.verifyProxies(new ArrayList<>(tmpList)); } } }
31.254237
106
0.692516
e0656811b5a9d454df62548d06aeed622feafc5a
3,878
/******************************************************************************* * Copyright 2014 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * * 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 gov.nasa.arc.spife.europa.clientside; public enum EuropaCommand { // Europa2 commands. // Server methods GET_SERVER_VERSION("GetServerVersion"), STOP_SERVER("StopServer"), START_SESSION("StartSession"), STOP_SESSION("StopSession"), // Session-specific methods ADD_CONTAINS_RELATION("AddContainsRelation"), ADD_TEMPORAL_BOUND_CONSTRAINT("AddTemporalBoundConstraint"), ADD_TEMPORAL_RELATION_CONSTRAINT("AddTemporalRelationConstraint"), CLEAR_ACTIVITY_SERVER_INFO("ClearActivityServer"), CONTINUE_FIXING("ContinueFixing"), CREATE_OBJECTS("CreateObjects"), DISABLE_ACTIVITY_FLIGHT_RULE_ACTIVE_ENFORCEMENT("DisableActivityFlightRuleActiveEnforcement"), DISABLE_CATEGORY_ACTIVE_ENFORCEMENT("DisableCategoryActiveEnforcement"), DISABLE_GLOBAL_FLIGHT_RULE_ACTIVE_ENFORCEMENT("DisableGlobalFlightRuleActiveEnforcement"), DISABLE_GLOBAL_FLIGHT_RULE_PASSIVE_ENFORCEMENT("DisableGlobalFlightRulePassiveEnforcement"), DISABLE_SINGLE_RULE_ACTIVE_ENFORCEMENT("DisableSingleRuleActiveEnforcement"), ENABLE_ACTIVITY_FLIGHT_RULE_ACTIVE_ENFORCEMENT("EnableActivityFlightRuleActiveEnforcement"), ENABLE_CATEGORY_ACTIVE_ENFORCEMENT("EnableCategoryActiveEnforcement"), ENABLE_GLOBAL_FLIGHT_RULE_ACTIVE_ENFORCEMENT("EnableGlobalFlightRuleActiveEnforcement"), ENABLE_GLOBAL_FLIGHT_RULE_PASSIVE_ENFORCEMENT("EnableGlobalFlightRulePassiveEnforcement"), ENABLE_SINGLE_RULE_ACTIVE_ENFORCEMENT("EnableSingleRuleActiveEnforcement"), END_FIXING("EndFixing"), FIX_VIOLATIONS("FixViolations"), FIX_VIOLATIONS_PROGRESSIVELY("FixViolationsProgressive"), GET_ACTIVITY_BOUNDS("GetActivityBounds"), GET_ACTIVITY_CONSTRAINTS("GetActivityConstraints"), GET_CPU_WINDOWS("GetCpuWindows"), GET_INCON_PARAMETERS("GetInconParameters"), GET_FINCON_INFO("GetFinconInfo"), GET_FLIGHT_RULE_NAMES("GetFlightRuleNames"), GET_GLOBAL_STRING("GetGlobalString"), GET_NOGOOD("GetNogood"), GET_RESOURCE_IN_TIME_FORMAT("getResourceInTmFormat"), GET_VIOLATIONS("GetViolations"), IS_CONSISTENT("IsConsistent"), REGISTER_ACTIVITY("RegisterActivity"), REGISTER_CONTAINER("RegisterContainer"), REGISTER_SUBACTIVITY("RegisterSubActivity"), REMOVE_CONTAINS_RELATION("RemoveContainsRelation"), REMOVE_TEMPORAL_CONSTRAINT("RemoveTemporalConstraint"), RENAME_ACTIVITY("RenameActivity"), SET_ACTIVITY_OBJECT("SetActivityObject"), SET_ACTIVITY_PARAM_VALUE("SetActivityParamValue"), SET_ACTIVITY_START_TIME("SetActivityStartTime"), SET_SINGLE_ACTIVITY_SINGLE_RULE_ENFORCEMENT("SetEnforcementSubvalue"), SET_SUBACTIVITY_OFFSET("SetSubActivityOffset"), START_FIXING("StartFixing"), UNREGISTER_ACTIVITY("UnregisterActivity"), UNREGISTER_CONTAINER("UnregisterContainer"), UPDATE_ACTIVITY_DURATION("UpdateActivityDuration"), // Server side debug commands. TIMER_START("TimerStart"), TIMER_STOP("TimerStop"), ; final String xmlrpcString; private EuropaCommand(String xmlrpcString) { this.xmlrpcString = xmlrpcString; } public String getXmlrpcString() { return xmlrpcString; } }
42.152174
95
0.792935
4cabdebff482f1b625fa85080ab2d5b33ac43aa6
4,115
import java.util.*; class Item { public int item_id; public String description; public int price_per_quantity; public Item(int item_id, String description, int price_per_quantity) { this.item_id = item_id; this.description = description; this.price_per_quantity = price_per_quantity; } public int getItem_id() { return item_id; } public void setItem_id(int item_id) { this.item_id = item_id; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getPrice_per_quantity() { return price_per_quantity; } public void setPrice_per_quantity(int price_per_quantity) { this.price_per_quantity = price_per_quantity; } } class Bill { public String bill_id="B"; public int bill_amount; public static int counter=1000; public void generate_bill_amount(List <Integer> item_quantity,List <Item> item_s,List <Integer> available_items) { counter++; bill_id=bill_id+counter; for(int i=0;i<item_quantity.size();i++) { if(item_quantity.get(i)<=available_items.get(i)) { available_items.set(i,available_items.get(i)-item_quantity.get(i)); bill_amount=bill_amount+((item_quantity.get(i))*(item_s.get(i).price_per_quantity)); } else{ System.out.println("Stock Empty"); } } } public int getBill_amount() { return bill_amount; } public void setBill_amount(int bill_amount) { this.bill_amount = bill_amount; } public static int getCounter() { return counter; } public static void setCounter(int counter) { Bill.counter = counter; } } class Customer { public String customer_name; public String payment_status="Not Paid"; Customer(String n) { customer_name=n; } public void pays_bill(Bill b) { payment_status="Paid"; System.out.println("Customer_name:" + customer_name + " Bill_id:" + b.bill_id + " Bill_Amount:"+b.bill_amount); } public String getCustomer_name() { return customer_name; } public void setCustomer_name(String customer_name) { this.customer_name = customer_name; } public String getPayment_status() { return payment_status; } public void setPayment_status(String payment_status) { this.payment_status = payment_status; } } public class Relationship_Answer_3 { public static void main(String Args[]) { Scanner scan=new Scanner(System.in); List <Customer> c=new ArrayList<>(); List<Item> it=new ArrayList<>(); List<Integer> aq=new ArrayList<>(); List<Bill> b=new ArrayList<>(); for(int i=0;i<2;i++) { System.out.println("Enter item_id"); int id=scan.nextInt(); System.out.println("Enter description"); String s=scan.next(); System.out.println("Enter price_per_quantity"); int ppq=scan.nextInt(); System.out.println("Enter available quantity"); int a=scan.nextInt(); aq.add(a); it.add(new Item(id,s,ppq)); } for(int i=0;i<2;i++) { System.out.println("Enter customer name"); String n=scan.next(); c.add(new Customer(n)); List<Integer> req=new ArrayList<>(); req.clear(); for(int j=0;j<2;j++) { System.out.println("How much of item "+j); int q=scan.nextInt(); req.add(q); } Bill B=new Bill(); b.add(B); B.generate_bill_amount(req,it,aq); } System.out.println("Enter Bill No."); int bn=scan.nextInt(); c.get(bn).pays_bill(b.get(bn)); scan.close(); } }
26.548387
120
0.573026
965f844cfd5a49b6adf268e58cf9add1be4febdb
1,386
package en.sunny.inheritance.rest; import java.time.Instant; import java.util.List; import org.springframework.data.rest.webmvc.PersistentEntityResource; import org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler; import org.springframework.data.rest.webmvc.RepositoryRestController; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.hateoas.CollectionModel; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import en.sunny.inheritance.entities.Publication; import en.sunny.inheritance.repositories.PublicationADO; @RepositoryRestController public class PublicationController { private PublicationADO publicationADO; public PublicationController(PublicationADO publicationADO) { this.publicationADO=publicationADO; } @GetMapping("/publications/search/betweenDates") @ResponseBody public CollectionModel<PersistentEntityResource> betweenDates ( @RequestParam("from") @DateTimeFormat(pattern="yyyy-MM-dd") Instant from, @RequestParam("to") @DateTimeFormat(pattern="yyyy-MM-dd") Instant to, PersistentEntityResourceAssembler assembler) { List<Publication> publications = publicationADO.betweenDates(from, to); return assembler.toCollectionModel(publications); } }
38.5
78
0.83189
e03ab7bbbf3d012e0c9bf769e36f194a4e3ec0d9
2,686
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.com.uechi.util; import java.util.Date; /** * * @author paulo.uechi */ public class configuracao { private Boolean booRepetir; public Boolean getBooRepetir() { return booRepetir; } public void setBooRepetir(Boolean booRepetir) { this.booRepetir = booRepetir; } private String strAplicacao; public String getStrAplicacao() { return strAplicacao; } public void setStrAplicacao(String strAplicacao) { this.strAplicacao = strAplicacao; } private Date datAgendarInicio; public Date getDatAgendarInicio() { return datAgendarInicio; } public void setDatAgendarInicio(Date datAgendarInicio) { this.datAgendarInicio = datAgendarInicio; } private Date datAgendarFim; public Date getDatAgendarFim() { return datAgendarFim; } public void setDatAgendarFim(Date datAgendarFim) { this.datAgendarFim = datAgendarFim; } private int intAgendarTipo; public int getIntAgendarTipo() { return intAgendarTipo; } public void setIntAgendarTipo(int intAgendarTipo) { this.intAgendarTipo = intAgendarTipo; } private Boolean booAgendar; public Boolean getBooAgendar() { return booAgendar; } public void setBooAgendar(Boolean booAgendar) { this.booAgendar = booAgendar; } private int ideAplicacao; public int getIdeAplicacao() { return ideAplicacao; } public void setIdeAplicacao(int ideAplicacao) { this.ideAplicacao = ideAplicacao; } private long lngIntervalo; public long getlngIntervalo() { return lngIntervalo; } public void setlngIntervalo(long lngIntervalo) { this.lngIntervalo = lngIntervalo; } private String ConexaoLog; public String getConexaoLog() { return ConexaoLog; } public void setConexaoLog(String ConexaoLog) { this.ConexaoLog = ConexaoLog; } private String ConexaoDBMSQL; public String getConexaoDBMSQL() { return ConexaoDBMSQL; } public void setConexaoDBMSQL(String ConexaoDBMSQL) { this.ConexaoDBMSQL = ConexaoDBMSQL; } private String ConexaoDBMYSQL; public String getConexaoDBMYSQL() { return ConexaoDBMYSQL; } public void setConexaoDBMYSQL(String ConexaoDBMYSQL) { this.ConexaoDBMYSQL = ConexaoDBMYSQL; } }
20.821705
79
0.656739
8a54dfa01f063acb868c0cd12e37a89aacbf5100
5,922
/* Foilen Infra UI https://github.com/foilen/foilen-infra-ui Copyright (c) 2017-2021 Foilen (https://foilen.com) The MIT License http://opensource.org/licenses/MIT */ package com.foilen.infra.ui.services; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.foilen.infra.api.model.permission.LinkAction; import com.foilen.infra.api.model.permission.PermissionLink; import com.foilen.infra.api.model.permission.PermissionResource; import com.foilen.infra.api.model.permission.ResourceAction; import com.foilen.infra.plugin.v1.core.eventhandler.changes.AuditUserType; import com.foilen.infra.ui.repositories.AllOwnersDefinedInRolesRepository; import com.foilen.infra.ui.repositories.RoleRepository; import com.foilen.infra.ui.repositories.documents.AbstractUser; import com.foilen.smalltools.tools.AbstractBasics; import com.foilen.smalltools.tools.JsonTools; import com.foilen.smalltools.tools.StringTools; @Service @Transactional public class UserPermissionsServiceImpl extends AbstractBasics implements UserPermissionsService { public static final PermissionResource ALL_PERMISSION_RESOURCE = new PermissionResource() // .setAction(ResourceAction.ALL) // .setExplicitChange(true) // .setOwner("*") // .setType("*") // ; public static final PermissionLink ALL_PERMISSION_LINK = new PermissionLink() // .setAction(LinkAction.ALL) // .setExplicitChange(true) // .setFromOwner("*") // .setFromType("*") // .setLinkType("*") // .setToOwner("*") // .setToType("*") // ; @Autowired private AllOwnersDefinedInRolesRepository allOwnersDefinedInRolesRepository; @Autowired private EntitlementService entitlementService; @Autowired private RoleRepository roleRepository; private Set<String> allOwners() { TreeSet<String> owners = allOwnersDefinedInRolesRepository.findAll(Sort.by("owner")).stream() // .map(it -> it.getOwner()) // .collect(Collectors.toCollection(() -> new TreeSet<>())); owners.add(""); return owners; } @Override public List<PermissionLink> findLinkPermissions(AuditUserType userType, String userId) { List<PermissionLink> permissionLink = new ArrayList<>(); // System if (userType == AuditUserType.SYSTEM) { permissionLink.add(JsonTools.clone(ALL_PERMISSION_LINK)); return permissionLink; } // User AbstractUser user = entitlementService.getUser(userId); if (user == null) { return permissionLink; } if (user.isAdmin()) { permissionLink.add(JsonTools.clone(ALL_PERMISSION_LINK)); } else { permissionLink.addAll(roleRepository.findAllByNameIn(user.getRoles()).flatMap(it -> it.getLinks().stream()).collect(Collectors.toList())); } return permissionLink; } @Override public List<PermissionResource> findListResourcePermissions(String userId, ResourceAction filterByAction) { List<PermissionResource> permissionResources = findResourcePermissions(null, userId); // Keep only the desired action and not partial permissionResources.removeIf(pr -> (pr.getAction() != ResourceAction.ALL && pr.getAction() != filterByAction) // || pr.isPartial()); return permissionResources; } @Override public Set<String> findOwnersThatUserCanCreateAs(String userId) { Set<String> owners = new TreeSet<>(); AbstractUser user = entitlementService.getUser(userId); if (user == null) { return owners; } if (user.isAdmin()) { // Find all owners owners.addAll(allOwners()); } else { roleRepository.findAllById(user.getRoles()).forEach(role -> { role.getResources().forEach(resource -> { String owner = resource.getOwner(); if (owner == null || !resource.isExplicitChange()) { return; } if (resource.getAction() == ResourceAction.ALL || resource.getAction() == ResourceAction.VIEW) { if (StringTools.safeEquals(owner, "*")) { // Find all owners owners.addAll(allOwners()); return; } else { owners.add(owner); } } }); }); ; } return owners; } @Override public List<PermissionResource> findResourcePermissions(AuditUserType userType, String userId) { List<PermissionResource> permissionResources = new ArrayList<>(); // System if (userType == AuditUserType.SYSTEM) { permissionResources.add(JsonTools.clone(ALL_PERMISSION_RESOURCE)); return permissionResources; } // User AbstractUser user = entitlementService.getUser(userId); if (user == null) { return permissionResources; } if (user.isAdmin()) { permissionResources.add(JsonTools.clone(ALL_PERMISSION_RESOURCE)); } else { permissionResources.addAll(roleRepository.findAllByNameIn(user.getRoles()).flatMap(it -> it.getResources().stream()).collect(Collectors.toList())); } return permissionResources; } }
34.430233
159
0.629348
6155b7ba47d0b55a73e3ac831ec8c3aee6f4431a
1,993
package com.github.rmohr.cockpitj.core.channel; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DbusCallBuilder { private final ObjectMapper objectMapper; private String path; private List<String> arguments; private String dbusInterface; private String method; private String id; private String channelId; protected DbusCallBuilder(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } public static DbusCallBuilder builder() { return builder(new ObjectMapper()); } public static DbusCallBuilder builder(ObjectMapper objectMapper) { return new DbusCallBuilder(objectMapper); } public DbusCallBuilder path(String path) { this.path = path; return this; } public DbusCallBuilder arguments(List<String> arguments) { this.arguments = arguments; return this; } public DbusCallBuilder dbusInterface(String dbusInterface) { this.dbusInterface = dbusInterface; return this; } public DbusCallBuilder method(String method) { this.method = method; return this; } public DbusCallBuilder id(String id) { this.id = id; return this; } public DbusCallBuilder channel(String channelId){ this.channelId = channelId; return this; } public String build() throws JsonProcessingException { Map<String, Object> command = new HashMap<>(); if (id != null) { command.put("id", id); } if (arguments == null) { arguments = new ArrayList<>(); } command.put("call", Arrays.asList(path, dbusInterface, method, arguments)); return channelId + "\n" + objectMapper.writeValueAsString(command); } }
26.573333
83
0.663322
11c083b48da5e9de64539b60ccbf855d5bc6d8cf
1,205
package com.DebjoyBuiltIt.placemark; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; public class MarkerModel extends RealmObject { @PrimaryKey private long id; private String title; private String emoji; public long getId() { return id; } public void setId(long id) { this.id = id; } private String color; private double latitude; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getEmoji() { return emoji; } public void setEmoji(String emoji) { this.emoji = emoji; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public double getLatitude() { return latitude; } public void setLatitude(double latitude) { this.latitude = latitude; } public double getLongitude() { return longitude; } public void setLongitude(double longitude) { this.longitude = longitude; } private double longitude; public MarkerModel(){ } }
16.971831
48
0.606639
df000bcc4dfadfe91a58d4382856ba01baeb931d
903
package com.infotamia.cosmetics.filters; import com.infotamia.cosmetics.rest.user.login.FacebookCustomerLoginResource; import javax.ws.rs.core.UriBuilder; import org.apache.commons.collections4.list.UnmodifiableList; import java.util.ArrayList; import java.util.List; /** * skip http requests from further processing. example request like {@link FacebookCustomerLoginResource}. * * @author Mohammed Al-Ani */ public class SkipFilterUtils { private static final UnmodifiableList<String> skippedUris; static { List<String> skip = new ArrayList<>(); skip.add(UriBuilder.fromResource(FacebookCustomerLoginResource.class).build().toString().substring(1)); skippedUris = new UnmodifiableList<>(skip); } private SkipFilterUtils() { } public static boolean shouldSkip(String path) { return skippedUris.stream().anyMatch(path::contains); } }
29.129032
111
0.739756
d11608ab5711dc267c5c6efbaba31d4bf38acb8d
1,746
package com.sunj.gankio.ui.fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import com.sunj.gankio.ui.base.BaseMultiPagesFragment; import com.sunj.gankio.util.ConstantUtils; import java.util.ArrayList; /** * @Description: * @Author: sunjing * @Time: 2018/10/13 10:12 PM */ public class CategoryPagesFragment extends BaseMultiPagesFragment { public static Fragment newInstance() { CategoryPagesFragment fragment = new CategoryPagesFragment(); Bundle bundle = new Bundle(); ArrayList<String> titleList = new ArrayList<>(); titleList.add(ConstantUtils.IMAGES); titleList.add(ConstantUtils.ANDROID); titleList.add(ConstantUtils.IOS); titleList.add(ConstantUtils.VIDEO); titleList.add(ConstantUtils.EXPANDING_RES); titleList.add(ConstantUtils.WEB_FRONT_END); titleList.add(ConstantUtils.ALL); bundle.putStringArrayList(BaseMultiPagesFragment.ARGUMENT_CHILD_FRAGMENT_TITLES, titleList); fragment.setArguments(bundle); return fragment; } @Override protected Fragment getChildFragment(int position) { switch (position) { case 0: return CategoryImagesFragment.newInstance(mTitleList.get(position)); case 1: case 2: case 5: return CategoryWebFragment.newInstance(mTitleList.get(position)); case 3: case 4: return CategoryTextFragment.newInstance(mTitleList.get(position)); case 6: return CategoryTextFragment.newInstance(mTitleList.get(position)); } return CategoryTextFragment.newInstance(mTitleList.get(position)); } }
32.943396
100
0.67354
f0e9391d0b8b63b4a86d4dc5783eaadb6fd33874
234
package com.revature.dao; import java.util.List; import com.banking.Application; public interface ApplicationDao { public void create(Application a); public void update(Application a); public List<Application> readAll(); }
15.6
36
0.764957
8139a3c8e782b7974aaebd20b9e75a8e4fc685f8
3,452
package com.rpc.server.provider.app; import com.rpc.server.provider.service.Calculator; import com.rpc.server.provider.service.CalculatorImpl; import com.rpc.server.rpcrequest.CalculateRpcRequest; import com.rpc.server.rpcrequest.SendRpcRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; /** * @description: 提供服务 * @author:SC19002999 * @create: 2020/4/23 **/ public class ProviderApp { private static Logger log = LoggerFactory.getLogger(ProviderApp.class); private Calculator calculator = new CalculatorImpl(); public static void main(String[] args) throws IOException { new ProviderApp().run(); } private void run() throws IOException { //创建ServerSocket对象,绑定并监听端口 ServerSocket listener = new ServerSocket(9090); System.out.println("服务端已启动,等待客户端连接.."); try { while (true) { //侦听并接受到此套接字的连接,返回一个Socket对象 Socket socket = listener.accept(); try { //得到一个输入流,接收客户端传递的信息 InputStream inputStream = socket.getInputStream(); // 将请求反序列化 ObjectInputStream objectInputStream = new ObjectInputStream(inputStream); Object object = objectInputStream.readObject(); System.out.print("object=" + object); ObjectOutputStream objectOutputStream = null; // 调用服务 int result = 0; //   instanceof 严格来说是Java中的一个双目运算符,用来测试一个对象是否为一个类的实例,用法为: boolean result = obj instanceof Class if (object instanceof CalculateRpcRequest) { CalculateRpcRequest calculateRpcRequest = (CalculateRpcRequest) object; if ("add".equals(calculateRpcRequest.getMethod())) { // 返回结果 result = calculator.add(calculateRpcRequest.getA(), calculateRpcRequest.getB()); objectOutputStream = new ObjectOutputStream(socket.getOutputStream()); objectOutputStream.writeObject(new Integer(result)); } else { throw new UnsupportedOperationException(); } } String result2 = null; if (object instanceof SendRpcRequest) { SendRpcRequest sendRpcRequest = (SendRpcRequest) object; if ("send".equals(sendRpcRequest.getMethod())) { // 返回结果 result2 = calculator.send(sendRpcRequest.getStr()); objectOutputStream = new ObjectOutputStream(socket.getOutputStream()); objectOutputStream.writeObject(new String(result2)); } else { throw new UnsupportedOperationException(); } } } catch (Exception e) { log.error("fail", e); } finally { socket.close(); } } } finally { listener.close(); } } }
37.11828
114
0.550116
8b2766f4481a37caffee3e0fa3041cc95d913d73
780
package com.pacgame.provider; import com.pacgame.provider.alignment.*; public class AlignmentProviderImpl implements AlignmentProvider { @Override public VerticalAlignmentProvidedObject getTop() { return new Top(); } @Override public VerticalAlignmentProvidedObject getVCenter() { return new VCenter(); } @Override public VerticalAlignmentProvidedObject getBottom() { return new Bottom(); } @Override public HorizontalAlignmentProvidedObject getLeft() { return new Left(); } @Override public HorizontalAlignmentProvidedObject getHCenter() { return new HCenter(); } @Override public HorizontalAlignmentProvidedObject getRight() { return new Right(); } }
21.666667
65
0.678205
7ca94dc1020301021088bf279ab9cb42ee3f16da
1,823
package com.fishercoder.solutions; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.PriorityQueue; public class _621 { public static class Solution1 { public int leastInterval(char[] tasks, int n) { Map<Character, Integer> map = new HashMap<>(); for (char c : tasks) { map.put(c, map.getOrDefault(c, 0) + 1); } PriorityQueue<Task> maxHeap = new PriorityQueue<>((a, b) -> b.total - a.total); for (Map.Entry<Character, Integer> entry : map.entrySet()) { maxHeap.offer(new Task(entry.getValue(), entry.getKey())); } int times = 0; while (!maxHeap.isEmpty()) { int i = 0; List<Task> temp = new ArrayList<>(); while (i <= n) { if (!maxHeap.isEmpty()) { if (maxHeap.peek().total > 1) { Task curr = maxHeap.poll(); temp.add(new Task(curr.total - 1, curr.character)); } else { maxHeap.poll(); } } times++; if (maxHeap.isEmpty() && temp.size() == 0) { break; } i++; } for (Task task : temp) { maxHeap.offer(task); } } return times; } class Task { int total; char character; public Task(int total, char character) { this.total = total; this.character = character; } } } }
30.898305
91
0.420735
04d3484105c8e58ecc012b54537d78614fc91a3c
1,248
package challenges.strings; import java.util.HashMap; /* * A string is said to be a child of a another string if it can be formed by deleting 0 or more characters from the other string. Given two strings of equal length, what's the longest string that can be constructed such that it is a child of both? For example, ABCD and ABDC have two children with maximum length 3, ABC and ABD. They can be formed by eliminating either the D or C from both strings. Note that we will not consider ABCD as a common child because we can't rearrange characters and ABCD ABDC. * * * */ public class CommonChild { /* * Takes O(n*m) time complexity * Takes O(n) space complexity * * */ static int commonChild(String s1, String s2) { int n = s1.length(); int[] memo = new int[n + 1]; for (int i = 1; i <= n; i++) { int prev = 0; for (int j = 1; j <= n; j++) { int temp = memo[j]; if (s1.charAt(i - 1) == s2.charAt(j - 1)) { memo[j] = prev + 1; } else { memo[j] = Math.max(memo[j], memo[j - 1]); } prev = temp; } } return memo[n]; } }
32
259
0.553686
a8cbc30551d507c183582ba63782ce00954565cd
2,889
package com.coding.coupon.template.common; import com.coding.coupon.common.DictDefinition; import com.coding.coupon.common.JsonConverter; import com.coding.coupon.common.vo.TemplateRule; import javax.persistence.AttributeConverter; /** * 转换器集合类. * * <p>创建时间: <font style="color:#00FFFF">20191214 14:36</font><br> * AttributeConverter<X, Y> <br> * X: 是实体属性的类型<br> * Y: 是数据库字段的类型 * * @author Rushing0711 * @version 1.0.0 * @since 1.0.0 */ public interface JpaConverter { /** 优惠券分类枚举属性转换器. */ class CouponCategoryConverter implements AttributeConverter<DictDefinition.CouponCategoryEnum, Integer> { /** 将实体属性X转换为Y存储到数据库中,插入和更新时执行的动作. */ @Override public Integer convertToDatabaseColumn(DictDefinition.CouponCategoryEnum couponCategory) { return couponCategory.getCode(); } /** 将数据库中的字段Y转换为实体属性X,查询操作时执行的动作. */ @Override public DictDefinition.CouponCategoryEnum convertToEntityAttribute(Integer value) { return DictDefinition.CouponCategoryEnum.ofCodeNoisy(value); } } /** 产品线枚举属性转换器. */ class ProductLineConverter implements AttributeConverter<DictDefinition.ProductLineEnum, Integer> { /** 将实体属性X转换为Y存储到数据库中,插入和更新时执行的动作. */ @Override public Integer convertToDatabaseColumn(DictDefinition.ProductLineEnum productLine) { return productLine.getCode(); } /** 将数据库中的字段Y转换为实体属性X,查询操作时执行的动作. */ @Override public DictDefinition.ProductLineEnum convertToEntityAttribute(Integer value) { return DictDefinition.ProductLineEnum.ofCodeNoisy(value); } } /** 分发目标枚举属性转换器. */ class DistributeTargetConverter implements AttributeConverter<DictDefinition.DistributeTargetEnum, Integer> { /** 将实体属性X转换为Y存储到数据库中,插入和更新时执行的动作. */ @Override public Integer convertToDatabaseColumn(DictDefinition.DistributeTargetEnum target) { return target.getCode(); } /** 将数据库中的字段Y转换为实体属性X,查询操作时执行的动作. */ @Override public DictDefinition.DistributeTargetEnum convertToEntityAttribute(Integer value) { return DictDefinition.DistributeTargetEnum.ofCodeNoisy(value); } } /** 优惠券模板规则属性转换器. */ class RuleConverter implements AttributeConverter<TemplateRule, String> { /** 将实体属性X转换为Y存储到数据库中,插入和更新时执行的动作. */ @Override public String convertToDatabaseColumn(TemplateRule rule) { return JsonConverter.toJson(rule); } /** 将数据库中的字段Y转换为实体属性X,查询操作时执行的动作. */ @Override public TemplateRule convertToEntityAttribute(String value) { return JsonConverter.fromJson(value, TemplateRule.class); } } }
32.1
99
0.656282
0b413362293379c87381f6349f3b29d3ddfcb89d
3,156
package com.activiti.common.utils; import com.activiti.common.quartz.QuartzManager; import com.activiti.mapper.ScheduleMapper; import com.activiti.mapper.UserMapper; import com.activiti.pojo.schedule.ScheduleDto; import com.activiti.pojo.user.StudentWorkInfo; import com.alibaba.fastjson.JSONArray; import org.joda.time.DateTime; import org.joda.time.Days; import org.joda.time.Minutes; import org.joda.time.Seconds; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.List; @Component public class SlotHelp implements ApplicationContextAware { @Autowired private QuartzManager quartzManager; @Autowired private ScheduleMapper scheduleMapper; @Autowired private CommonUtil commonUtil; @Autowired private UserMapper userMapper; @Autowired private ActivitiHelper activitiHelper; private static final String cron = "0 0 0 * * *"; //每天执行一次 @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { executeMe(); } @Scheduled(cron = cron) private void executeMe() { List<ScheduleDto> scheduleDtoList = scheduleMapper.selectAllOfScheduleTime(); scheduleDtoList.forEach(scheduleDto -> { String courseCode = scheduleDto.getCourseCode(); List<StudentWorkInfo> studentWorkInfoList = userMapper.selectAllNonDistributeUser(courseCode); if (null != studentWorkInfoList && studentWorkInfoList.size() > 0) { DateTime last = new DateTime(studentWorkInfoList.get(0).getLastCommitTime()); DateTime first = new DateTime(studentWorkInfoList.get(studentWorkInfoList.size() - 1).getLastCommitTime()); int maxTime = commonUtil.getNumFromString(scheduleDto.getAssessmentMaxTimeSlot()); int diff = 0; if (scheduleDto.getAssessmentMinTimeSlot().contains("M") && scheduleDto.getAssessmentMaxTimeSlot().contains("M")) diff = Minutes.minutesBetween(first, last).getMinutes(); if (scheduleDto.getAssessmentMinTimeSlot().contains("D") && scheduleDto.getAssessmentMaxTimeSlot().contains("D")) diff = Days.daysBetween(first, last).getDays(); if (scheduleDto.getAssessmentMinTimeSlot().contains("S") && scheduleDto.getAssessmentMaxTimeSlot().contains("S")) diff = Seconds.secondsBetween(first, last).getSeconds(); if (diff > maxTime) { studentWorkInfoList.forEach(studentWorkInfo -> { userMapper.updateDistributeStatus(courseCode, studentWorkInfo.getEmailAddress()); activitiHelper.startTeacherVerify(studentWorkInfo); }); } } }); } }
45.085714
129
0.704373
63829c272d157a89799c37e58c2274561e3e4df8
2,085
package org.prototype4fun.experimental.data; import com.google.common.hash.HashFunction; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; import org.apache.commons.lang3.RandomStringUtils; import org.jetbrains.annotations.NotNull; import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; /** * Created by Radek on 17.11.2016. */ @State(Scope.Benchmark) public class Generator { public static final HashFunction sha1 = Hashing.sha1(); public static final HashFunction sha256 = Hashing.sha256(); public static final String CAPS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public static final String LOWS = CAPS.toLowerCase(); public static final String LETT = CAPS + LOWS; public static final String NUMS = "1234567890"; public static final String ALLS = CAPS + LOWS + NUMS; public static final Charset CHARSET = Charset.defaultCharset(); public static final Random RANDOM = new Random(System.currentTimeMillis()); public String sha1(List<String> predicates, int num) { return sha(predicates, num, sha1.newHasher()); } public byte[] sha1B(List<byte[]> predicates, int num) { return shaB(predicates, num, sha1.newHasher()); } public String sha256(List<String> predicates, int num) { return sha(predicates, num, sha256.newHasher()); } @NotNull private byte[] shaB(List<byte[]> predicates, int num, Hasher h) { for(int i=0;i<num;i++){ h.putBytes(predicates.get(RANDOM.nextInt(predicates.size()))); } return h.hash().asBytes(); } @NotNull private String sha(List<String> predicates, int num, Hasher h) { for(int i=0;i<num;i++){ h.putString(predicates.get(RANDOM.nextInt(predicates.size())),CHARSET); } return h.hash().toString(); } }
32.076923
83
0.696403
1398796fdb64fab733fbe86b90bbc4205dafb338
2,837
package net.uoit.rmd.asm; import lombok.Getter; import org.objectweb.asm.Type; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; /** * Represents a set of dependencies that class * may have */ class DependencySet { private final @Getter Set<String> dependencies = new HashSet<>(); /** * A list of packages to filter out because they should not be migrated * as they already exists on the server side. */ public static final List<String> PACKAGE_FILTER = Arrays.asList( "java.", "javax.", "net.uoit.rmd.", "kotlin." ); /** * Add a dependency to the set based on the type descriptor * * @param desc The type descriptor */ public void addDesc(final String desc) { if (desc == null || !desc.contains("L")) // primitive return; Type type = Type.getType(desc); if (desc.contains("[")) type = type.getElementType(); addInternalName(type.getInternalName()); } /** * Add dependency by its internal name * * @param internalName The internal name of the class */ public void addInternalName(final String internalName) { if (internalName == null) return; String name = internalName; if (internalName.contains("(")) throw new RuntimeException(internalName); if (internalName.contains("[")) { final Type elementType = Type.getType(internalName).getElementType(); if (isPrimitive(elementType)) return; name = elementType.getInternalName(); } name = name.replace("/", "."); for (final String s : PACKAGE_FILTER) { if (name.startsWith(s) && !name.endsWith("NonDeterministic")) return; } dependencies.add(name); } /** * Adds a method to the dependency set * * @param methodDesc The method descriptor */ public void addMethod(final String methodDesc) { final Type type = Type.getMethodType(methodDesc); final String retType = type.getReturnType().getDescriptor(); addDesc(retType); final Type[] argumentTypes = type.getArgumentTypes(); for (final Type argumentType : argumentTypes) { addDesc(argumentType.getDescriptor()); } } private boolean isPrimitive(final Type type) { return Type.VOID_TYPE.equals(type) || Type.BYTE_TYPE.equals(type) || Type.SHORT_TYPE.equals(type) || Type.INT_TYPE.equals(type) || Type.LONG_TYPE.equals(type) || Type.FLOAT_TYPE.equals(type) || Type.DOUBLE_TYPE.equals(type) || Type.CHAR_TYPE.equals(type) || Type.BOOLEAN_TYPE.equals(type); } }
27.019048
111
0.600282
81a2bb0151880a655f05a8295be87f2c85eedc69
922
package com.saaavsaaa.client.zookeeper; import com.saaavsaaa.client.zookeeper.section.ZookeeperListener; import org.apache.zookeeper.WatchedEvent; /** * Created by aaa */ public class TestSupport { public static final String AUTH = "digest"; public static final String SERVERS = "127.0.0.1:3333"; public static final int SESSION_TIMEOUT = 200000;//ms public static final String ROOT = "test"; public static ZookeeperListener buildListener(){ ZookeeperListener listener = new ZookeeperListener(null) { @Override public void process(WatchedEvent event) { System.out.println("=========================================================="); System.out.println(event.toString()); System.out.println("=========================================================="); } }; return listener; } }
34.148148
97
0.559653
69179cda64f812323156e91b9fe8f4e8ba6a7064
815
package app; import template.Fibonacci; public class Solve { public static void main(String[] args) { int min = 0; int max = 20; try { // Simple tests to verify user entry. for (long n = min; n < max; n++) { long userValue = Fibonacci.fibonacci(n); long expectedValue = success.Fibonacci.fibonacci(n); Logger.logCurrentTest(userValue, n); if (expectedValue != userValue) { Logger.logNoMatch(expectedValue); System.exit(1); } } // all test passed successfully Logger.logSuccess(); } catch (RuntimeException e) { Logger.logException(e); System.exit(1); } } }
25.46875
68
0.494479
aac51d3ac257d16e79bdddf7d111c26364141da8
26,989
/* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.msc.service; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.concurrent.Future; import org.jboss.msc.inject.FieldInjector; import org.jboss.msc.inject.SetMethodInjector; import org.jboss.msc.service.ServiceBuilder.DependencyType; import org.jboss.msc.service.ServiceController.Mode; import org.jboss.msc.service.ServiceController.State; import org.jboss.msc.util.TestServiceListener; import org.jboss.msc.value.Value; import org.jboss.msc.value.Values; import org.junit.Test; /** * Tests scenarios involving services with non-null values, optional dependencies, and injections. * <p> * Plus, in this test case the container is not shutdown on tear down. This enables the automatic shutdown process * triggered by a shutdown hook defined in {@link ServiceContainerImpl}. * * @author <a href="mailto:flavia.rainone@jboss.com">Flavia Rainone</a> */ public class CompleteServiceTestCase extends AbstractServiceTest { private static final ServiceName serviceNameA = ServiceName.of("service", "A"); private static final ServiceName serviceNameB = ServiceName.of("service", "B"); private static final ServiceName serviceNameD = ServiceName.of("service", "D"); private static final ServiceName fooServiceName = ServiceName.of("foo", "service"); @Override public void tearDown() { // do not shutdown the container } @Test public void test1() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceA serviceA = new ServiceA(); final ServiceB serviceB = new ServiceB(); final ServiceBWrapper serviceBWrapper = new ServiceBWrapper(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(); final Future<ServiceController<?>> serviceDStart = testListener.expectServiceStart(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addInjection(new SetMethodInjector<ServiceD>(Values.immediateValue(serviceD), ServiceD.class.getDeclaredMethod("setService", ServiceD.class))) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertController(serviceDController, serviceDStart); assertSame(serviceD, serviceDController.getValue()); assertSame(serviceC, serviceD.service); assertSame(serviceD, serviceD.getService()); final Future<ServiceController<?>> serviceBStart = testListener.expectServiceStart(serviceNameB); final ServiceController<?> serviceBController = serviceContainer.addService(serviceNameB, serviceBWrapper) .addInjection( new SetMethodInjector<ServiceB>(Values.immediateValue(serviceBWrapper), getMethod(ServiceBWrapper.class, "setValue", ServiceB.class)), serviceB) .addListener(testListener) .install(); assertController(serviceNameB, serviceBController); assertController(serviceBController, serviceBStart); assertSame(serviceB, serviceBController.getValue()); final Value<ServiceA> serviceAValue = Values.immediateValue(serviceA); final Future<ServiceController<?>> serviceAStart = testListener.expectServiceStart(serviceNameA); final ServiceController<?> serviceAController = serviceContainer.addService(serviceNameA, serviceA) .addInjection(new FieldInjector<String>(serviceAValue, getField(ServiceA.class, "description")), "serviceA") .addInjection(new FieldInjector<Integer>(serviceAValue, getField(ServiceA.class, "initialParameter")), 2215) .addDependency(serviceNameB, new FieldInjector<Object>(serviceAValue, getField(ServiceA.class, "serviceB"))) .addDependency(serviceNameD, new SetMethodInjector<Object>(Values.immediateValue(serviceA), getMethod(ServiceA.class, "setServiceD", ServiceD.class))) .addListener(testListener) .install(); assertController(serviceNameA, serviceAController); assertController(serviceAController, serviceAStart); assertSame(serviceA, serviceAController.getValue()); assertEquals("serviceA", serviceA.description); assertEquals(2215, serviceA.initialParameter); assertSame(serviceB, serviceA.serviceB); assertSame(serviceC, serviceA.serviceC); final Future<ServiceController<?>> fooStart = testListener.expectServiceStart(fooServiceName); ServiceController<?> fooController = serviceContainer.addService(fooServiceName, Service.NULL) .addDependency(serviceNameB).addListener(testListener).install(); assertController(fooServiceName, fooController); assertController(fooController, fooStart); final Future<ServiceController<?>> serviceAStop = testListener.expectServiceStop(serviceNameA); serviceAController.setMode(Mode.NEVER); assertController(serviceAController, serviceAStop); assertSame(serviceA, serviceAController.getValue()); assertNull(serviceA.description); assertEquals(0, serviceA.initialParameter);; assertNull(serviceA.serviceB); assertNull(serviceA.serviceC); serviceBController.setMode(Mode.ON_DEMAND); // b doesn't go down, as there is still a dependent running (foo service) assertSame(State.UP, serviceBController.getState()); final Future<ServiceController<?>> fooServiceStop = testListener.expectServiceStop(fooServiceName); final Future<ServiceController<?>> serviceBStop = testListener.expectServiceStop(serviceNameB); // now b can go down fooController.setMode(Mode.NEVER); assertController(fooController, fooServiceStop); assertController(serviceBController, serviceBStop); try { serviceBController.getValue(); fail ("IllegalStateException expected"); } catch (IllegalStateException e) {} } @Test public void test2() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceA serviceA = new ServiceA(); final ServiceB serviceB = new ServiceB(); final ServiceBWrapper serviceBWrapper = new ServiceBWrapper(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(); final ServiceE serviceE = new ServiceE(); // install service D, with service C injected final Future<ServiceController<?>> serviceDStart = testListener.expectServiceStart(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertController(serviceDController, serviceDStart); assertSame(serviceC, serviceD.service); // install serviceE as foo service, with service D injected in it, and with the listener below final Future<ServiceController<?>> serviceEStart = testListener.expectServiceStart(fooServiceName); final ServiceController<?> serviceEController = serviceContainer.addService(fooServiceName, serviceE) .addDependency(serviceNameD, ServiceD.class, new SetMethodInjector<ServiceD>( Values.immediateValue(serviceE), getMethod(ServiceE.class, "initialize", ServiceD.class))) .addListener(testListener) .addListener(new AbstractServiceListener<Void>() { public void transition(final ServiceController<? extends Void> controller, final ServiceController.Transition transition) { if (transition.enters(State.REMOVED)) { // when service E is removed, install service A as foo service final Value<ServiceA> serviceAValue = Values.immediateValue(serviceA); try { // install service A as foo service, with a description injected, an initial parameter // plus service D and service B injected serviceContainer.addService(fooServiceName, serviceA).addInjection(new FieldInjector<String>(serviceAValue, getField(ServiceA.class, "description")), "foo") .addInjection(new FieldInjector<Integer>(serviceAValue, getField(ServiceA.class, "initialParameter")), 2218) .addDependency(serviceNameB, new FieldInjector<Object>(serviceAValue, getField(ServiceA.class, "serviceB"))) .addDependency(serviceNameD, new SetMethodInjector<Object>(Values.immediateValue(serviceA), getMethod(ServiceA.class, "setServiceD", ServiceD.class))) .addListener(testListener) .install(); } catch (IllegalArgumentException e) { throw new RuntimeException(e); } catch (ServiceRegistryException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } } } }).install(); assertController(fooServiceName, serviceEController); assertController(serviceEController, serviceEStart); assertSame(serviceD, serviceE.serviceD); final Future<ServiceController<?>> serviceEStop = testListener.expectServiceStop(fooServiceName); // disable service E serviceEController.setMode(Mode.NEVER); assertController(serviceEController, serviceEStop); // remove service E, thus triggering the listener above final Future<ServiceController<?>> serviceERemoval = testListener.expectServiceRemoval(fooServiceName); final Future<ServiceController<?>> serviceAInstalledAsServiceE = testListener.expectListenerAdded(fooServiceName); serviceEController.setMode(Mode.REMOVE); assertController(serviceEController, serviceERemoval); assertNull(serviceE.serviceD); final ServiceController<?> serviceAController = assertController(fooServiceName, serviceAInstalledAsServiceE); // install service B, which will allow service A to start final Future<ServiceController<?>> serviceBStart = testListener.expectServiceStart(serviceNameB); final Future<ServiceController<?>> serviceAStart = testListener.expectServiceStart(fooServiceName); serviceContainer.addService(serviceNameB, serviceBWrapper) .addInjection( new SetMethodInjector<ServiceB>(Values.immediateValue(serviceBWrapper), getMethod(ServiceBWrapper.class, "setValue", ServiceB.class)), serviceB) .addListener(testListener) .install(); final ServiceController<?> serviceBController = assertController(serviceNameB, serviceBStart); assertSame(serviceB, serviceBController.getValue()); assertController(serviceAController, serviceAStart); assertSame(serviceA, serviceAController.getValue()); assertEquals("foo", serviceA.description); assertEquals(2218, serviceA.initialParameter); assertSame(serviceB, serviceA.serviceB); assertNotNull(serviceA.serviceC); } @Test public void test4() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceB serviceB = new ServiceB(); final ServiceBWrapper serviceBWrapper = new ServiceBWrapper(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(); final Future<ServiceController<?>> serviceDStart = testListener.expectServiceStart(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertController(serviceDController, serviceDStart); assertSame(serviceD, serviceDController.getValue()); assertSame(serviceC, serviceD.service); final Future<ServiceController<?>> serviceBStart = testListener.expectServiceStart(serviceNameB); final ServiceController<?> serviceBController = serviceContainer.addService(serviceNameB, serviceBWrapper) .addInjection( new SetMethodInjector<ServiceB>(Values.immediateValue(serviceBWrapper), getMethod(ServiceBWrapper.class, "setValue", ServiceB.class)), serviceB) .addListener(testListener) .install(); assertController(serviceNameB, serviceBController); assertController(serviceBController, serviceBStart); assertSame(serviceB, serviceBController.getValue()); } @Test public void test5() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(true); // install service D, with service C injected final Future<ServiceController<?>> serviceDStart = testListener.expectServiceStart(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertController(serviceDController, serviceDStart); assertSame(serviceC, serviceD.service); // serviceD stop will fail, but this will be ignored final Future<ServiceController<?>> serviceDStop = testListener.expectServiceStop(serviceNameD); serviceDController.setMode(Mode.NEVER); assertController(serviceDController, serviceDStop); assertNull(serviceD.service); } @Test public void testServiceWithInvalidInjection() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(NullPointerException.class); // install service D, with service C injected, but with a typo final Future<StartException> serviceFailure = testListener.expectServiceFailure(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addInjection(new SetMethodInjector(serviceD, ServiceD.class.getDeclaredMethod("setInjectionException", Class.class)), IllegalStateException.class) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertFailure(serviceDController, serviceFailure); assertNull(serviceD.service); serviceD.setInjectionException(null); final Future<ServiceController<?>> serviceWontStart = testListener.expectServiceWontStart(serviceNameD); serviceDController.setMode(Mode.NEVER); assertController(serviceDController, serviceWontStart); final Future<ServiceController<?>> serviceStart = testListener.expectServiceStart(serviceNameD); serviceDController.setMode(Mode.ACTIVE); assertController(serviceDController, serviceStart); assertSame(IllegalStateException.class, serviceD.getInjectionException()); assertSame(serviceC, serviceD.getSomeService()); final Future<ServiceController<?>> serviceStop = testListener.expectServiceStop(serviceNameD); serviceDController.setMode(Mode.NEVER); assertController(serviceDController, serviceStop); assertNull(serviceD.getInjectionException()); assertTrue(serviceD.getSomeService() == null || serviceD.getSomeService() == serviceC); } @Test public void testServiceWithInvalidUninjection() throws Exception { final TestServiceListener testListener = new TestServiceListener(); final ServiceC serviceC = new ServiceC(); final ServiceD serviceD = new ServiceD(); // install service D, with service C injected final Future<ServiceController<?>> serviceStart = testListener.expectServiceStart(serviceNameD); final ServiceController<?> serviceDController = serviceContainer.addService(serviceNameD, serviceD) .addInjection(new SetMethodInjector<SomeService>(Values.immediateValue(serviceD), getMethod(ServiceD.class,"setSomeService", SomeService.class)), serviceC) .addListener(testListener) .install(); assertController(serviceNameD, serviceDController); assertController(serviceDController, serviceStart); assertSame(serviceC, serviceD.service); serviceD.setInjectionException(UnknownError.class); final Future<ServiceController<?>> serviceStop = testListener.expectServiceStop(serviceNameD); serviceDController.setMode(Mode.NEVER); assertController(serviceDController, serviceStop); assertSame(serviceC, serviceD.service); } @Test public void temporaryServiceValue() throws Throwable { final TestServiceListener testListener = new TestServiceListener(); final ServiceValue<ServiceA> serviceValue = new ServiceValue<ServiceA>(new ServiceA()); final Future<ServiceController<?>> serviceAStart = testListener.expectServiceStart(serviceNameA); serviceContainer.addServiceValue(serviceNameA, serviceValue).addListener(testListener).install(); final ServiceController<?> serviceAController = assertController(serviceNameA, serviceAStart); serviceValue.setService(null); final Future<ServiceController<?>> serviceAStop = testListener.expectServiceStop(serviceNameA); serviceAController.setMode(Mode.NEVER); assertController(serviceAController, serviceAStop); } public static class ServiceA implements Service<ServiceA> { public String description; public int initialParameter; public ServiceB serviceB; public ServiceC serviceC; @Override public ServiceA getValue() throws IllegalStateException { return this; } @Override public void start(StartContext context) throws StartException { assertContextClassLoader(this.getClass().getClassLoader()); assertTrue(context.getElapsedTime() > 0L); } @Override public void stop(StopContext context) { assertContextClassLoader(this.getClass().getClassLoader()); assertTrue(context.getElapsedTime() > 0L); } public void setServiceD(ServiceD serviceD) { if (serviceD == null) { serviceC = null; } else { serviceC = (ServiceC) serviceD.getSomeService(); } } } public static class ServiceB { boolean startedService; public void start(){ assertContextClassLoader(this.getClass().getClassLoader()); startedService = true; } public void stop() { assertContextClassLoader(this.getClass().getClassLoader()); startedService = false; } public boolean isServiceStarted() { return startedService; } } public static class ServiceBWrapper implements Service<ServiceB> { private ServiceB serviceB; public void setValue(ServiceB serviceB) { this.serviceB = serviceB; } @Override public ServiceB getValue() throws IllegalStateException { if (serviceB == null) { throw new IllegalStateException(); } return serviceB; } @Override public void start(StartContext context) throws StartException { assertContextClassLoader(this.getClass().getClassLoader()); serviceB.start(); assertTrue(context.getElapsedTime() > 0L); } @Override public void stop(StopContext context) { assertContextClassLoader(this.getClass().getClassLoader()); serviceB.stop(); assertTrue(context.getElapsedTime() > 0L); } } public static class ServiceC implements SomeService {} public static interface SomeService {} public static class ServiceD implements Service<ServiceD> { private SomeService service; private boolean failToStop = false; private Class<? extends Throwable> injectionException = null; private ServiceD serviceD; // should contain this public ServiceD() {} public ServiceD(boolean failToStop) { this.failToStop = failToStop; } public ServiceD(Class<? extends Throwable> injectionException) { this.injectionException = injectionException; } public Class<? extends Throwable> getInjectionException() { return injectionException; } public void setInjectionException(Class<? extends Throwable> injectionException) { this.injectionException = injectionException; } /** * @param serviceC the serviceC to set */ public void setSomeService(SomeService service) throws Throwable { if (injectionException != null) { try { throw injectionException.newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } this.service = service; } /** * @return the serviceC */ public SomeService getSomeService() { return service; } @Override public ServiceD getValue() throws IllegalStateException { return this; } public void setService(ServiceD serviceD) { this.serviceD = serviceD; } public ServiceD getService() { return serviceD; } @Override public void start(StartContext context) throws StartException { assertContextClassLoader(this.getClass().getClassLoader()); assertTrue(context.getElapsedTime() > 0L); } @Override public void stop(StopContext context) { assertContextClassLoader(this.getClass().getClassLoader()); if (failToStop) { throw new RuntimeException(); } assertTrue(context.getElapsedTime() > 0L); } } public static class ServiceE implements Service<Void> { public ServiceD serviceD; public void initialize(ServiceD serviceD) { this.serviceD = serviceD; } @Override public Void getValue() throws IllegalStateException { return null; } @Override public void start(StartContext context) throws StartException { assertContextClassLoader(this.getClass().getClassLoader()); assertTrue(context.getElapsedTime() > 0L); } @Override public void stop(StopContext context) { assertContextClassLoader(this.getClass().getClassLoader()); assertTrue(context.getElapsedTime() > 0L); } } public static class ServiceValue<T> implements Value<Service<T>> { private Service<T> service; public ServiceValue (Service<T> service) { this.service = service; } @Override public Service<T> getValue() throws IllegalStateException, IllegalArgumentException { return service; } public void setService(Service<T> service) { this.service = service; } } private static Field getField(final Class<?> clazz, final String name) throws NoSuchFieldException { return clazz.getField(name); } private static Method getMethod(final Class<?> clazz, final String methodName, final Class<?> paramType) { final Method method; try { method = clazz.getMethod(methodName, paramType); } catch (NoSuchMethodException e) { throw new IllegalArgumentException("No such method found '" + clazz + "." + methodName + "(" + paramType + ")'", e); } return method; } }
46.855903
190
0.679758
e8f9dc2b57046b099b66b5d43363b7181ac02352
1,060
package amu.zhcet.core.error; import amu.zhcet.data.ItemNotFoundException; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; @Slf4j @ControllerAdvice class GlobalControllerExceptionHandler { private String getNotFoundTitle(ItemNotFoundException infe) { if (infe.getId() == null) return infe.getType() + " Not Found"; return String.format("%s %s Not Found", infe.getType(), infe.getId()); } @ResponseStatus(HttpStatus.NOT_FOUND) @ExceptionHandler(ItemNotFoundException.class) public String handleNotFound(Model model, ItemNotFoundException infe) { model.addAttribute("page_title", getNotFoundTitle(infe)); model.addAttribute("type", infe.getType()); model.addAttribute("id", infe.getId()); return "not_found"; } }
34.193548
78
0.742453