100+ results for 'new RuntimeException(e)'
Not the results you expected?
Throwables2Test.java (https://github.com/richardcloudsoft/legacy-jclouds.git) Java · 269 lines
156 Exception e = new TestException();
157 propagateIfPossible(new RuntimeException(e),
158 ImmutableSet.<TypeToken<? extends Throwable>> of(typeToken(TestException.class)));
159 }
168 Exception e = new IllegalStateException();
169 propagateIfPossible(new RuntimeException(e), ImmutableSet.<TypeToken<? extends Throwable>> of());
170 }
220 Exception e = new ResourceNotFoundException();
221 propagateIfPossible(new RuntimeException(e), ImmutableSet.<TypeToken<? extends Throwable>> of());
222 }
262 Exception e = new HttpResponseException("goo", createNiceMock(HttpCommand.class), null);
263 propagateIfPossible(new RuntimeException(e), ImmutableSet.<TypeToken<? extends Throwable>> of());
264 }
RemoteDebuggerClient.java (https://github.com/machak/intellij-community.git) Java · 545 lines
77 while (t != null) {
78 if (t instanceof SocketException || t instanceof EOFException) {
79 throw new DebuggerStoppedException();
80 }
81 t = t.getCause();
82 }
83 return e.getCause() instanceof RuntimeException ? (RuntimeException)e.getCause() : new RuntimeException(e);
84 }
230 try {
231 final List<RemoteBreakpoint> list = myManager.getBreakpoints();
232 final ArrayList<Breakpoint> breakpoints = new ArrayList<Breakpoint>(list.size());
233 for (RemoteBreakpoint breakpoint : list) {
234 breakpoints.add(new MyBreakpoint(breakpoint));
StandardSpiderPlot.java (https://gitlab.com/samuel-davis/JasperReports-OSGI) Java · 450 lines
120 interiorGap = spiderPlot.getInteriorGap();
121 axisLineColor = spiderPlot.getAxisLineColor();
122 axisLineWidth = spiderPlot.getAxisLineWidth();
123 labelGap = spiderPlot.getLabelGap();
124 labelColor = spiderPlot.getLabelColor();
324 *
325 */
326 public void setAxisLineWidth(Float axisLineWidth)
327 {
328 Object old = this.axisLineWidth;
329 this.axisLineWidth = axisLineWidth;
330 getEventSupport().firePropertyChange(PROPERTY_AXIS_LINE_WIDTH, old, this.axisLineWidth);
426 catch (CloneNotSupportedException e)
427 {
428 throw new JRRuntimeException(e);
429 }
GitCacheDirectoryTest.java (https://bitbucket.org/cofarrell/bamboo-git-plugin.git) Java · 209 lines
101 GitRepositoryAccessData accessDataShallow = createSampleAccessData(true);
103 accessDataNonShallow = GitRepositoryAccessData.builder(accessDataNonShallow).branch(new VcsBranchImpl("")).build();
104 accessDataShallow = GitRepositoryAccessData.builder(accessDataShallow).branch(new VcsBranchImpl("")).build();
148 final ArrayBlockingQueue<Boolean> hasBlocked = new ArrayBlockingQueue<Boolean>(1);
149 final CountDownLatch firstCalled = new CountDownLatch(1);
150 final CountDownLatch secondCalled = new CountDownLatch(1);
171 catch (Exception e)
172 {
173 throw new RuntimeException(e);
174 }
175 }
197 catch (Exception e)
198 {
199 throw new RuntimeException(e);
200 }
201 }
ModelClassVisitor.java (https://github.com/branaway/play.git) Java · 296 lines
43 */
44 public ModelClassVisitor() {
45 this(new ClassWriter(ClassWriter.COMPUTE_MAXS));
46 }
230 MethodVisitor mv = cv.visitMethod(ACC_PUBLIC + ACC_STATIC, "create",
231 "(Ljava/lang/String;Lplay/mvc/Scope$Params;)Lplay/db/jpa/JPABase;", null,
232 new String[] { "java/lang/Exception" });
233 mv.visitCode();
234 getJPQL(mv);
247 ModelClassVisitor modelClassVisitor = new ModelClassVisitor();
248 new ClassReader(new ByteArrayInputStream(code)).accept(modelClassVisitor, 0);
249 return modelClassVisitor.output();
250 } catch (Exception e) {
251 throw new RuntimeException(e);
252 }
253 }
FrozenUDTTest.java (https://github.com/beobal/cassandra.git) Java · 153 lines
VolatileNotificationRepoAndFactoryStressTest.java (https://github.com/jenkinsci/html-audio-notifier-plugin.git) Java · 189 lines
36 private final CountDownLatch readyForAction = new CountDownLatch(NUM_CLIENTS);
37 private final CountDownLatch start = new CountDownLatch(1);
38 private final CountDownLatch completed = new CountDownLatch(NUM_CLIENTS);
39 private final Set<String> completedClients = Collections.synchronizedSet(new HashSet<String>());
54 assertEquals(asList(n), repo.findNewerThan(asNotificationId(n.getId().getValue() - 1)));
55 assertEquals(asList(n), repo.findNewerThan(null));
57 System.out.println("completed in " + (System.currentTimeMillis() - started) + "ms");
77 l.await(30, TimeUnit.SECONDS));
78 } catch (InterruptedException e) {
79 throw new RuntimeException(e);
80 }
81 }
SenseiClientRequest.java (https://bitbucket.org/icosplays/sensei.git) Java · 309 lines
132 public Builder groupBy(List<String> columns, int top) {
133 request.groupBy = new GroupBy(columns, top);
134 return this;
135 }
157 public Builder addTemplateMapping(String name, Object value) {
158 if (request.templateMapping == null) {
159 request.templateMapping = new HashMap<String, Object>();
160 }
161 request.templateMapping.put(name, value);
173 request.sort.add(new JSONObject().put(sort.getField(), sort.getOrder().name()));
174 } catch (JSONException e) {
175 throw new RuntimeException(e);
176 }
177 }
Tokenizer.java (https://github.com/thinrope/carrot2.git) Java · 225 lines
64 @Input
65 @Attribute
66 public Collection<String> documentFields = Arrays.asList(new String []
67 {
68 Document.TITLE, Document.SUMMARY
103 // Fields to tokenize
104 final String [] fieldNames = documentFields.toArray(new String [documentFields.size()]);
106 if (fieldNames.length > 8)
107 {
108 throw new ProcessingException("Maximum number of tokenized fields is 8.");
109 }
SQLServer.java (https://gitlab.com/marcelosabino/OpenbusBR) Java · 413 lines
60 case 4: metricUnit = (java.lang.String)value$; break;
61 case 5: metricName = (java.lang.String)value$; break;
62 default: throw new org.apache.avro.AvroRuntimeException("Bad index");
63 }
64 }
161 /** Creates a new SQLServer RecordBuilder by copying an existing Builder */
162 public static br.com.produban.openbus.model.avro.SQLServer.Builder newBuilder(br.com.produban.openbus.model.avro.SQLServer.Builder other) {
163 return new br.com.produban.openbus.model.avro.SQLServer.Builder(other);
166 /** Creates a new SQLServer RecordBuilder by copying an existing SQLServer instance */
167 public static br.com.produban.openbus.model.avro.SQLServer.Builder newBuilder(br.com.produban.openbus.model.avro.SQLServer other) {
168 return new br.com.produban.openbus.model.avro.SQLServer.Builder(other);
407 return record;
408 } catch (Exception e) {
409 throw new org.apache.avro.AvroRuntimeException(e);
410 }
411 }
AbstractTextEdit.java (https://github.com/dscassel/Pydev.git) Java · 106 lines
44 this.scopeAdapter = ((IExtractMethodRefactoringRequest)req).getScopeAdapter();
45 }
46 this.nodeHelper = new NodeHelper(req.getAdapterPrefs());
47 this.adapterPrefs = req.getAdapterPrefs();
48 this.astFactory = new PyAstFactory(this.nodeHelper.getAdapterPrefs());
58 MakeAstValidForPrettyPrintingVisitor.makeValid(node);
59 }catch(Exception e){
60 throw new RuntimeException(e);
61 }
67 private String getIndentedSource(SimpleNode node, String source, int indent) {
68 StringBuilder indented = new StringBuilder();
69 String indentation = getIndentation(indent);
RestActionInvocationTest.java (https://github.com/nathanielksmith/javahaiku.git) Java · 270 lines
59 setUp();
60 methodResult = new DefaultHttpHeaders("show");
61 assertEquals("show", restActionInvocation.saveResult(actionConfig, methodResult));
62 assertEquals(methodResult, restActionInvocation.httpHeaders);
169 "org.apache.struts2.dispatcher.HttpHeaderResult")
170 .addParam("status", "123").build();
171 ActionConfig actionConfig = new ActionConfig.Builder("org.apache.rest",
172 "RestAction", "org.apache.rest.RestAction")
173 .addResultConfig(resultConfig)
244 action = new RestAction();
245 setMimeTypeHandlerSelector(new DefaultContentTypeHandlerManager());
246 unknownHandlerManager = new DefaultUnknownHandlerManager();
248 XWorkTestCaseHelper.setUp();
249 } catch (Exception e) {
250 throw new RuntimeException(e);
251 }
252 invocationContext = ActionContext.getContext();
GridLicenseUtil.java (https://github.com/simonetripodi/gridgain.git) Java · 233 lines
RemotingConnectorService.java (https://github.com/maschmid/jboss-as.git) Java · 99 lines
52 private RemotingConnectorServer server;
54 private final InjectedValue<MBeanServer> mBeanServer = new InjectedValue<MBeanServer>();
56 private final InjectedValue<Endpoint> endpoint = new InjectedValue<Endpoint>();
58 @Override
59 public synchronized void start(final StartContext context) throws StartException {
60 server = new RemotingConnectorServer(mBeanServer.getValue(), endpoint.getValue());
61 try {
62 server.start();
71 server.stop();
72 } catch (IOException e) {
73 throw new RuntimeException(e);
74 }
75 }
FileUtilsImpl.java (https://github.com/jmchilton/TINT.git) Java · 303 lines
52 return FileUtils.readFileToByteArray(file);
53 } catch(final IOException e) {
54 throw new IORuntimeException(e);
55 }
56 }
60 FileUtils.writeStringToFile(file, data);
61 } catch(final IOException e) {
62 throw new IORuntimeException(e);
63 }
64 }
152 FileUtils.deleteDirectory(directory);
153 } catch(final IOException e) {
154 throw new IORuntimeException(e);
155 }
156 }
ProtocolAsynchronizer.java (https://bitbucket.org/spoticus/yellowbird-mta.git) Java · 167 lines
XmlUtil.java (https://github.com/oburakevych/Integration-Payments.git) Java · 142 lines
57 public static byte[] prependXmlDeclaration(byte[] doc) throws Exception {
58 if (!hasValidXmlDeclaration(doc)) {
59 byte[] newdoc = new byte[doc.length + XML_DECL.length];
60 System.arraycopy(XML_DECL, 0, newdoc, 0, XML_DECL.length);
77 DocumentBuilder documentBuilder = dbf.newDocumentBuilder();
78 documentBuilder.setEntityResolver(resolver);
79 Document doc = documentBuilder.parse(new ByteArrayInputStream(xml));
81 return doc;
87 public static byte[] toByteArray(Node doc) {
88 try {
89 Transformer transformer = TransformerFactory.newInstance().newTransformer();
90 transformer.setOutputProperty(OutputKeys.INDENT, "yes");
97 return os.toByteArray();
98 } catch (Exception e) {
99 throw new RuntimeException(e);
100 }
101 }
ShadowRemoteViews.java (https://github.com/pivotal-linea/robolectric.git) Java · 127 lines
24 private String packageName;
25 private int layoutId;
26 private List<ViewUpdater> viewUpdaters = new ArrayList<ViewUpdater>();
28 public void __constructor__(String packageName, int layoutId) {
43 @Implementation
44 public void setTextViewText(int viewId, final CharSequence text) {
45 viewUpdaters.add(new ViewUpdater(viewId) {
46 @Override
47 public void doUpdate(View view) {
61 pendingIntent.send(view.getContext(), 0, null);
62 } catch (PendingIntent.CanceledException e) {
63 throw new RuntimeException(e);
64 }
65 }
MetadataTest.java (https://github.com/jduey/cucumber-jvm.git) Java · 113 lines
24 public class MetadataTest {
25 public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
27 @Test
45 private List<CucumberFeature> features() {
46 List<CucumberFeature> features = new ArrayList<CucumberFeature>();
47 FeatureBuilder fb = new FeatureBuilder(features);
48 fb.parse(new AbstractResource(new PathWithLines("test.feature")) {
49 @Override
50 public String getPath() {
63 .getBytes("UTF-8"));
64 } catch (UnsupportedEncodingException e) {
65 throw new RuntimeException(e);
66 }
67 }
ZooKeeperConnection.java (https://github.com/bryanduxbury/hank.git) Java · 223 lines
44 * subclasses to block while disconnected.
45 */
46 private CountDownLatch connectedSignal = new CountDownLatch(1);
48 private String connectString;
52 /**
53 * Creates a new connection to the ZooKeeper service. Blocks until we are
54 * connected to the service. Uses the default session timeout of 30 seconds.
55 *
101 // If we can't connect, then die so that someone can reconfigure.
102 LOG.fatal("Failed to connect to the ZooKeeper service", e);
103 throw new RuntimeException(e);
104 }
105 connectedSignal.await();
BucketizedHiveInputSplit.java (https://github.com/steeve/hive.git) Java · 198 lines
GamePanel.java (https://bitbucket.org/critnal/java.git) Java · 289 lines
117 } catch (Exception e) {
118 display.setText("Unandled Exception: " + e.getMessage());
119 throw new RuntimeException(e);
120 }
121 }
134 } catch (Exception e) {
135 display.setText("Unandled Exception: " + e.toString());
136 throw new RuntimeException(e);
137 }
138 }
164 } catch (Exception e) {
165 display.setText("Unandled Exception: " + e.toString());
166 throw new RuntimeException(e);
167 }
168 }
207 constraints.weighty = 10;
208 newGameButton = new JButton("Start New Game");
209 newGameButton.addActionListener(this);
AuthenticationProcessorImpl.java (https://gitlab.com/admin-github-cloud/thunder) Java · 179 lines
62 messageExecutor.sendMessageUpwards(message);
63 } else {
64 throw new RuntimeException("Should not happen, which class is this? " + message);
65 }
118 ECKey keyClient = node.ephemeralKeyClient;
120 byte[] data = new byte[keyServer.getPubKey().length + keyClient.getPubKey().length];
121 System.arraycopy(keyServer.getPubKey(), 0, data, 0, keyServer.getPubKey().length);
122 System.arraycopy(keyClient.getPubKey(), 0, data, keyServer.getPubKey().length, keyClient.getPubKey().length);
129 } catch (NoSuchProviderException | NoSuchAlgorithmException e) {
130 throw new RuntimeException(e);
131 }
132 }
BasicAntBuilder.java (https://github.com/andrewhj-mn/gradle.git) Java · 108 lines
45 children = (List) childrenField.get(target);
46 } catch (Exception e) {
47 throw new RuntimeException(e);
48 }
85 return nodeField.get(this);
86 } catch (IllegalAccessException e) {
87 throw new RuntimeException(e);
88 }
89 }
97 children.clear();
98 } catch (IllegalAccessException e) {
99 throw new RuntimeException(e);
100 }
101 return value;
PortalInstance.java (https://github.com/danielreuther/liferay-portal.git) Java · 213 lines
DefaultSignatureValidator.java (https://github.com/lujop/AndroidBillingLibrary.git) Java · 107 lines
51 return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey));
52 } catch (NoSuchAlgorithmException e) {
53 throw new RuntimeException(e);
54 } catch (InvalidKeySpecException e) {
55 Log.e(BillingController.LOG_TAG, "Invalid key specification.");
56 throw new IllegalArgumentException(e);
57 } catch (Base64DecoderException e) {
58 Log.e(BillingController.LOG_TAG, "Base64 decoding failed.");
59 throw new IllegalArgumentException(e);
60 }
61 }
SerializationFactory.java (https://github.com/nivertech/storm.git) Java · 207 lines
58 }
59 });
60 put(4, new ISerialization<Double>() {
61 public boolean accept(Class c) {
62 return Double.class.equals(c);
163 LOG.info("Could not find serialization for " + serializationClassName + ". Skipping...");
164 } else {
165 throw new RuntimeException(e);
166 }
167 } catch(InstantiationException e) {
168 throw new RuntimeException(e);
169 } catch(IllegalAccessException e) {
170 throw new RuntimeException(e);
171 }
172 }
EntityBeanComponentInstance.java (https://github.com/dobozysaurus/jboss-as.git) Java · 218 lines
94 getInstance().unsetEntityContext();
95 } catch (RemoteException e) {
96 throw new RuntimeException(e);
97 }
98 super.destroy();
121 throw e;
122 } catch (Exception e) {
123 throw new RuntimeException(e);
124 }
125 }
141 throw e;
142 } catch (Exception e) {
143 throw new RuntimeException(e);
144 }
145 }
RDFSliceRDFInputStreamInterator.java (https://bitbucket.org/emarx/rdfslice.git) Java · 143 lines
32 public RDFSliceRDFInputStreamInterator(InputStream is) throws Exception {
33 if(is == null) {
34 throw new Exception("InputStream could not be Null.");
35 }
36 this.is = is;
40 private void init(InputStream is) throws Exception {
41 br = new LineNumberReader(new InputStreamReader(is, Charset.forName("UTF-8")));
42 bIS = new BufferedInputStream(is);
43 prefixTable = new HashMap<String, String>();
44 }
50 || readLine()!=null);
51 } catch (IOException e) {
52 throw new RuntimeException(e);
53 }
54 }
BaseGeo2TagService.java (https://github.com/e-learning/geotracker.git) Java · 268 lines
88 throw new RuntimeException("Incorrect subscribeChannel() params format", e);
89 } catch (IOException e) {
90 throw new RuntimeException(e);
91 }
92 }
248 throw new RuntimeException("Incorrect rssSession() params format", e);
249 } catch (IOException e) {
250 throw new RuntimeException(e);
251 }
252 }
261 throw new RuntimeException("Incorrect auth_token format: {" + authToken + "}", e);
262 } catch (IOException e) {
263 throw new RuntimeException(e);
264 }
265 }
JRFillXyzSeries.java (https://gitlab.com/samuel-davis/JasperReports-OSGI) Java · 142 lines
Petr06.java (https://github.com/lantoli/Google-Code-Jam.git) Java · 161 lines
20 inputStream = new FileInputStream("sample.in");
21 } catch (IOException e) {
22 throw new RuntimeException(e);
23 }
24 OutputStream outputStream;
26 outputStream = new FileOutputStream("sample.out");
27 } catch (IOException e) {
28 throw new RuntimeException(e);
29 }
30 InputReader in = new InputReader(inputStream);
144 tokenizer = new StringTokenizer(reader.readLine());
145 } catch (IOException e) {
146 throw new RuntimeException(e);
147 }
148 }
UnmodifiableCollectionsSerializer.java (https://github.com/opentripplanner/OpenTripPlanner.git) Java · 174 lines
46 /**
47 * Creates a new {@link UnmodifiableCollectionsSerializer} and registers its serializer for the
48 * several unmodifiable Collections that can be created via {@link Collections}, including {@link
49 * Map}s.
79 throw e;
80 } catch (Exception e) {
81 throw new RuntimeException(e);
82 }
83 }
103 throw e;
104 } catch (Exception e) {
105 throw new RuntimeException(e);
106 }
107 }
OsmResponseParser.java (https://github.com/e-learning/gwik.git) Java · 152 lines
35 return parse(urlc.getInputStream());
36 } catch (IOException e) {
37 throw new RuntimeException(e);
38 } finally {
39 if (urlc != null) {
58 } catch (Exception e) {
59 throw new RuntimeException(e);
60 } finally {
61 is.close();
147 private Document parserXML(InputStream is) throws SAXException, IOException, ParserConfigurationException {
148 return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
149 }
DefaultSeamTransaction.java (https://github.com/LightGuard/seam-transaction.git) Java · 172 lines
FilterDuplicates.java (https://bitbucket.org/CharlesJB/mugqic_pipeline.git) Java · 369 lines
82 filterDups();
83 } catch (Exception e) {
84 throw new RuntimeException(e);
85 }
151 read1Writer = new BufferedWriter(
152 new OutputStreamWriter(new GZIPOutputStream(
153 new FileOutputStream(read1OutputFile)),
158 read2Writer = new BufferedWriter(new OutputStreamWriter(
159 new GZIPOutputStream(new FileOutputStream(
160 read2OutputFile)), Charset.forName("ASCII")));
206 read1Writer.append('@').append(
207 read1Sequence.getHeader());
208 read1Writer.newLine();
209 read1Writer.append(read1Sequence.getSequence());
210 read1Writer.newLine();
ParserTest.java (https://github.com/JetBrains/la-clojure.git) Java · 209 lines
YamlStream.java (https://github.com/bakerbaker/Marathon.git) Java · 95 lines
30 public class YamlStream {
31 private List<Object> nativeData = new ArrayList<Object>();
33 @SuppressWarnings("unchecked")
35 InputStream input = YamlDocument.class.getClassLoader().getResourceAsStream(
36 YamlDocument.ROOT + sourceName);
37 Yaml yaml = new Yaml();
38 for (Object document : yaml.loadAll(input)) {
39 nativeData.add(document);
45 presentation = output.toString("UTF-8");
46 } catch (UnsupportedEncodingException e) {
47 throw new RuntimeException(e);
48 }
49 // try to read generated presentation to prove that the presentation
PanelSizeProperties.java (https://bitbucket.org/teamwildtreechase/hatparsing.git) Java · 302 lines
239 if(fontStream == null)
240 {
241 throw new RuntimeException("Font \"" + DEFAULT_FONT_FILE_NAME + "\" not found... make sure it is in the right place");
242 }
243 return fontStream;
256 {
257 e.printStackTrace();
258 throw new RuntimeException(e);
259 } catch (IOException e)
260 {
261 e.printStackTrace();
262 throw new RuntimeException(e);
263 }
264 }
BluetoothDeviceDetailsRotationTest.java (https://gitlab.com/SkyDragon-OSP/platform_packages_apps_settings) Java · 105 lines
70 BluetoothDeviceDetailsFragment.sTestDataFactory =
71 new BluetoothDeviceDetailsFragment.TestDataFactory() {
72 @Override
73 public CachedBluetoothDevice getDevice(String deviceAddress) {
84 @Test
85 public void rotation() {
86 Intent intent = new Intent("android.settings.BLUETOOTH_SETTINGS");
87 SettingsActivity activity = (SettingsActivity) mInstrumentation.startActivitySync(intent);
88 Bundle args = new Bundle(1);
100 mUiDevice.setOrientationNatural();
101 } catch (RemoteException e) {
102 throw new RuntimeException(e);
103 }
104 }
KeystorePasswordCallback.java (https://gitlab.com/matticala/apache-camel) Java · 112 lines
64 callback.getClass().getMethod("setPassword", String.class).invoke(callback, pass);
65 } catch (Exception e) {
66 throw new RuntimeException(e);
67 }
68 }
71 return (String)callback.getClass().getMethod("getPassword").invoke(callback);
72 } catch (Exception e) {
73 throw new RuntimeException(e);
74 }
75 }
79 return (String)cb.getClass().getMethod("getIdentifier").invoke(cb);
80 } catch (Exception e) {
81 throw new RuntimeException(e);
82 }
83 }
StatelessSessionComponentInstance.java (https://github.com/luksa/wildfly.git) Java · 97 lines
47 /**
48 * Construct a new instance.
49 *
50 * @param component the component
65 final Interceptor interceptor = timeoutInterceptors.get(method);
66 if (interceptor == null) {
67 throw new RuntimeException("Unknown timeout method " + method);
68 }
69 try {
82 interceptor.processInvocation(context);
83 } catch (Exception e) {
84 throw new RuntimeException(e);
85 }
86 }
OperatorFactory.java (https://github.com/pkalmegh/hive.git) Java · 336 lines
83 public static ArrayList<OpTuple> opvec;
84 static {
85 opvec = new ArrayList<OpTuple>();
86 opvec.add(new OpTuple<FilterDesc>(FilterDesc.class, FilterOperator.class));
87 opvec.add(new OpTuple<SelectDesc>(SelectDesc.class, SelectOperator.class));
88 opvec.add(new OpTuple<ForwardDesc>(ForwardDesc.class, ForwardOperator.class));
89 opvec.add(new OpTuple<FileSinkDesc>(FileSinkDesc.class, FileSinkOperator.class));
90 opvec.add(new OpTuple<CollectDesc>(CollectDesc.class, CollectOperator.class));
160 } catch (Exception e) {
161 e.printStackTrace();
162 throw new RuntimeException(e);
163 }
164 }
MongoPersisterService.java (https://github.com/LaMaldicionDeMandos/PersisterService.git) Java · 108 lines
15 private final Mongo mongo;
16 private final DB db;
17 private final GsonMongoMapper mapper = new GsonMongoMapper();
18 private final ExampleFactory factory = new ExampleFactory();
20 public MongoPersisterService(String dbName, String host, int port){
21 try {
22 mongo = new Mongo(host,port);
23 db = mongo.getDB(dbName);
24 } catch (Exception e) {
25 throw new RuntimeException(e);
26 }
27 }
37 }
38 @SuppressWarnings("unchecked")
39 T newObject = (T)mapper.fromDbObject(dbObject, object.getClass());
40 return newObject;
LiferayUserDataWidget.java (https://github.com/bluesoft-rnd/aperte-workflow-core.git) Java · 160 lines
37 final PermissionChecker oldChecker = PermissionThreadLocal.getPermissionChecker();
38 try {
39 PermissionThreadLocal.setPermissionChecker(new PermissionChecker() { //TODO not the best way to do it?
40 @Override
41 public long getCompanyId() {
129 });
130 Role role = RoleServiceUtil.getRole(PortalUtil.getDefaultCompanyId(), liferayRoleName);
131 if (role == null) return new HashSet<UserData>();
132 long[] roleUserIds = UserServiceUtil.getRoleUserIds(role.getRoleId());
133 HashSet<UserData> users = new HashSet<UserData>();
146 }
147 } catch (Exception e) {
148 throw new RuntimeException(e);
149 }
StringValueDeserializer.java (https://gitlab.com/zouxc/dubbo) Java · 130 lines
65 _constructor = cl.getConstructor(new Class[] { String.class });
66 } catch (Exception e) {
67 throw new RuntimeException(e);
68 }
69 }
120 {
121 if (value == null)
122 throw new IOException(_cl.getName() + " expects name.");
124 try {
125 return _constructor.newInstance(new Object[] { value });
126 } catch (Exception e) {
127 throw new IOExceptionWrapper(e);
IgnoredFilesTest.java (https://github.com/maasvdberg/intellij-community.git) Java · 186 lines
66 }
67 catch (Exception e) {
68 throw new RuntimeException(e);
69 }
70 }
93 }
94 catch (Exception e) {
95 throw new RuntimeException(e);
96 }
97 }
128 final File dir = new File(myClientRoot, "a");
129 dir.mkdir();
130 final File innerDir = new File(dir, "innerDir");
131 innerDir.mkdir();
132 final File file1 = new File(innerDir, "file1");
IO.java (https://github.com/hsablonniere/play.git) Java · 368 lines
36 is.close();
37 } catch (Exception e) {
38 throw new RuntimeException(e);
39 }
40 return properties;
60 res = IOUtils.toString(is, encoding);
61 } catch(Exception e) {
62 throw new RuntimeException(e);
63 } finally {
64 try {
203 public static void writeContent(CharSequence content, OutputStream os, String encoding) {
204 try {
205 PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));
206 printWriter.println(content);
207 printWriter.flush();
SecondaryAuthenticationTests.java (https://github.com/dadoonet/elasticsearch.git) Java · 162 lines
74 assertThat(securityContext.getUser().principal(), equalTo("u1"));
76 final Authentication authentication2 = new Authentication(new User("u2", "role2"), realm(), realm());
77 final SecondaryAuthentication secondaryAuth = new SecondaryAuthentication(securityContext, authentication2);
111 } catch (InterruptedException e) {
112 Thread.currentThread().interrupt();
113 throw new RuntimeException(e);
114 }
115 }));
129 assertThat(securityContext.getUser().principal(), equalTo("u1"));
131 final Authentication authentication2 = new Authentication(new User("u2", "role2"), realm(), realm());
132 final SecondaryAuthentication secondaryAuth = new SecondaryAuthentication(securityContext, authentication2);
140 secondaryAuth.execute(originalContext -> {
141 assertThat(securityContext.getUser().principal(), equalTo("u2"));
142 ActionListener<Void> listener = new ContextPreservingActionListener<>(threadContext.newRestorableContext(false),
143 ActionListener.wrap(() -> listenerUser.set(securityContext.getUser())));
144 originalContext.restore();
GeoServerPreAuthenticationFilter.java (https://github.com/geoserver/geoserver.git) Java · 165 lines
39 private AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails>
40 authenticationDetailsSource = new WebAuthenticationDetailsSource();
41 protected AuthenticationEntryPoint aep;
44 public void initializeFromConfig(SecurityNamedServiceConfig config) throws IOException {
45 super.initializeFromConfig(config);
46 aep = new Http403ForbiddenEntryPoint();
47 }
109 roles = new ArrayList<>(getRoles(request, principal));
110 } catch (IOException e) {
111 throw new RuntimeException(e);
112 }
113 if (roles.contains(GeoServerRole.AUTHENTICATED_ROLE) == false)
BEncoder.java (https://github.com/gurkerl83/millipede.git) Java · 157 lines
22 */
23 public final class BEncoder {
24 static final Comparator<String> BYTE_COMPARATOR = new Comparator<String>() {
25 @Override
26 public int compare(String o1, String o2) {
51 return s.getBytes("UTF-8");
52 } catch (UnsupportedEncodingException e) {
53 throw new Error(e);
54 }
55 }
68 bencode(out, obj);
69 } catch (IOException e) {
70 throw new RuntimeException(e);
71 }
72 return out.toByteArray();
DisconnectTest.java (https://gitlab.com/JoshLucid/okhttp) Java · 132 lines
59 client = new OkHttpClient.Builder()
60 .socketFactory(new DelegatingSocketFactory(SocketFactory.getDefault()) {
61 @Override protected Socket configureSocket(Socket socket) throws IOException {
62 socket.setSendBufferSize(SOCKET_BUFFER_SIZE);
81 connection.setFixedLengthStreamingMode(requestBodySize);
82 OutputStream requestBody = connection.getOutputStream();
83 byte[] buffer = new byte[1024];
84 try {
85 for (int i = 0; i < requestBodySize; i += buffer.length) {
99 server.enqueue(new MockResponse()
100 .setBody(new Buffer().write(new byte[responseBodySize]))
101 .throttleBody(64 * 1024, 125, TimeUnit.MILLISECONDS)); // 500 Kbps
102 server.start();
124 connection.disconnect();
125 } catch (InterruptedException e) {
126 throw new RuntimeException(e);
127 }
128 }
DoubleDiscreteParameter.java (https://github.com/angri/OpenSHA.git) Java · 419 lines
91 public DoubleDiscreteParameter(String name, ArrayList doubles)
92 throws ConstraintException {
93 super(name, new DoubleDiscreteConstraint(doubles), null, null);
94 // if( constraint != null ) constraint.setName( name );
95 }
387 else
388 param =
389 new DoubleDiscreteParameter(name, c1, units, new Double(
390 this.value.toString()));
391 param.editable = true;
411 new ConstrainedDoubleDiscreteParameterEditor(this);
412 } catch (Exception e) {
413 throw new RuntimeException(e);
414 }
415 }
HandleDelegateImpl.java (https://bitbucket.org/cprenzberg/wildfly.git) Java · 119 lines
98 // Reconnect
99 final Stub stub = (Stub) object;
100 final ORB orb = (ORB) new InitialContext().lookup("java:comp/ORB");
101 stub.connect(orb);
102 } catch (NamingException ne) {
111 public static HandleDelegate getDelegate() {
112 try {
113 final InitialContext ctx = new InitialContext();
114 return (HandleDelegate) ctx.lookup("java:comp/HandleDelegate");
115 } catch (NamingException e) {
116 throw new NestedRuntimeException(e);
117 }
118 }
IndexCacheLoaderTest.java (https://bitbucket.org/cprenzberg/infinispan.git) Java · 112 lines
86 throws IOException {
87 final EmbeddedCacheManager cacheManager = initializeInfinispan(rootDir);
88 TestingUtil.withCacheManager(new CacheManagerCallable(cacheManager) {
89 public void call() {
90 Cache<Object, Object> cache = cacheManager.getCache();
91 Directory directory = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, indexName).create();
93 try {
94 TestHelper.verifyOnDirectory(directory, termsAdded, inverted);
95 } catch (IOException e) {
96 throw new RuntimeException(e);
97 }
98 }
SwitchableApplicationContextFactory.java (https://github.com/alfresco-mirror/alfresco-mirror.git) Java · 201 lines
KafkaConsumer.java (https://gitlab.com/zhengdingke/htest) Java · 250 lines
50 public KafkaConsumer(KafkaSpoutConfig config) {
51 this.config = config;
52 this.brokerList = new LinkedList<Host>(config.brokers);
53 this.brokerIndex = 0;
54 }
58 String topic = config.topic;
59 FetchRequest req = new FetchRequestBuilder().clientId(config.clientId).addFetch(topic, partition, offset, config.fetchMaxBytes)
60 .maxWait(config.fetchWaitMaxMs).build();
61 FetchResponse fetchResponse = null;
81 } else {
82 throw new RuntimeException(e);
83 }
84 }
BarcodeEvaluator.java (https://gitlab.com/samuel-davis/JasperReports-OSGI) Java · 181 lines
ForgotPassword.java (https://github.com/aaronmgross/Heinz-Disaster-Response-Mobile-Application.git) Java · 132 lines
58 if (u != null) {
60 String newPassword = genNewPassword();
61 u.setPassword(newPassword);
96 try {
97 Message message = new MimeMessage(session);
98 message.setFrom(new InternetAddress("account_update@redcross.org"));
101 message.setSubject("Disaster Assessment App Password Assistance");
102 message.setText("We received a request to reset the password associated with this e-mail address"
103 + "\n\n Your new password is: " + newPassword
104 + "\n\n Please log in using the new password and reset it as soon as possible. ");
110 } catch (MessagingException e) {
111 throw new RuntimeException(e);
112 }
113 }
TxControlServlet.java (https://github.com/ochaloup/jboss-as.git) Java · 145 lines
75 String includeParam = request.getParameter("include");
76 if (includeParam == null)
77 throw new IllegalStateException("No include parameter seen");
78 boolean include = Boolean.valueOf(includeParam);
80 String commitParam = request.getParameter("commit");
81 if (commitParam == null)
82 throw new IllegalStateException("No commit parameter seen");
83 boolean commit = Boolean.valueOf(commitParam);
88 transaction.begin();
89 } catch (Exception e) {
90 throw new RuntimeException(e);
91 }
TestResult.java (https://github.com/oracle/coherence.git) Java · 524 lines
44 /**
45 * Create a new TestResult with the specified data.
46 *
47 * @param cMillis the test duration in milliseconds
180 /**
181 * Return a new TestResult that represents the delta between this
182 * TestResult and the specified TestResult (i.e. this - that).
183 *
206 catch (CloneNotSupportedException e)
207 {
208 throw new RuntimeException(e);
209 }
ProvaServiceImpl.java (https://github.com/prova/prova.git) Java · 251 lines
58 engines.put(agent, prova);
59 } catch (Exception e) {
60 throw new RuntimeException(e);
61 }
62 return agent;
72 engines.put(agent, prova);
73 } catch (Exception e) {
74 throw new RuntimeException(e);
75 }
76 return agent;
105 return engine.consultSync(in, key, new Object[]{});
106 } catch (Exception e) {
107 throw new RuntimeException(e);
108 }
109 }
AbstractQueryServiceEndpoint.java (https://github.com/cts2/cts2-framework.git) Java · 205 lines
33 public abstract class AbstractQueryServiceEndpoint extends AbstractEndpoint {
35 private FilterResolver filterResolver = new FilterResolver();
37 protected <T, I> T doCount(
86 T directory;
87 try {
88 directory = directoryClazz.newInstance();
90 final Field field = ReflectionUtils.findField(directoryClazz,
101 ReflectionUtils.setField(field, directory, result.getEntries());
102 } catch (Exception e) {
103 throw new RuntimeException(e);
104 }
WhereClause.java (https://github.com/thepaul/cassandra.git) Java · 198 lines
35 // all relations (except for `<key> IN (.., .., ..)` which can be directly interpreted) from parser
36 // are stored into this array and are filtered to the keys/columns by extractKeysFromColumns(...)
37 private final List<Relation> clauseRelations = new ArrayList<Relation>();
38 private final List<Relation> columns = new ArrayList<Relation>();
40 // added to either by the parser from an IN clause or by extractKeysFromColumns
41 private final Set<Term> keys = new LinkedHashSet<Term>();
42 private Term startKey, finishKey;
43 private boolean includeStartKey = false, includeFinishKey = false, multiKey = false;
47 /**
48 * Create a new WhereClause with the first parsed relation.
49 *
50 * @param firstRelation key or column relation
148 catch (CharacterCodingException e)
149 {
150 throw new RuntimeException(e);
151 }
WikipediaIndexWorker.java (https://github.com/d5nguyenvan/Lucandra.git) Java · 130 lines
45 // each worker thread has a connection to cassandra
46 private static ConcurrentLinkedQueue<lucandra.IndexWriter> allClients = new ConcurrentLinkedQueue<IndexWriter>();
47 private static ThreadLocal<lucandra.IndexWriter> clientPool = new ThreadLocal<lucandra.IndexWriter>();
48 private static ThreadLocal<Integer> batchCount = new ThreadLocal<Integer>();
50 // get ring info
55 ring = client.describe_ring(CassandraUtils.keySpace);
56 } catch (Exception e) {
57 throw new RuntimeException(e);
58 }
59 }
113 if (article.text != null)
114 d.add(new Field("text", new String(article.text,"UTF-8"), Store.YES, Index.ANALYZED,TermVector.WITH_POSITIONS_OFFSETS));
116 d.add(new Field("url", article.url, Store.YES, Index.NOT_ANALYZED));
AbstractEntityFieldProcessor.java (https://github.com/kkmishra/Kundera.git) Java · 147 lines
TestFailoverProxy.java (https://github.com/Beckham007/hadoop-common.git) Java · 267 lines
62 getProxyLatch.await();
63 } catch (InterruptedException e) {
64 throw new RuntimeException(e);
65 }
66 }
165 new FlipFlopProxyProvider(UnreliableInterface.class,
166 new UnreliableImplementation("impl1"),
167 new UnreliableImplementation("impl2")),
228 result = unreliable.failsIfIdentifierDoesntMatch("impl2");
229 } catch (Exception e) {
230 throw new RuntimeException(e);
231 }
232 }
241 FlipFlopProxyProvider proxyProvider = new FlipFlopProxyProvider(
242 UnreliableInterface.class,
243 new UnreliableImplementation("impl1",
244 TypeOfExceptionToFailWith.STANDBY_EXCEPTION),
245 new UnreliableImplementation("impl2",
JournalFolderIndexerLocalizedTest.java (https://github.com/kiyoshilee/liferay-portal.git) Java · 206 lines
CyclocityServiceParser.java (https://github.com/jmorille/android.git) Java · 139 lines
68 @Override
69 public Station parseInputStreamForStationDispo(InputStream content, Station station) {
70 DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance();
71 try {
72 DocumentBuilder docBuilder = fabrique.newDocumentBuilder();
96 return station;
97 } catch (Exception e) {
98 throw new RuntimeException(e);
99 }
132 return values;
133 } catch (Exception e) {
134 throw new RuntimeException(e);
135 }
SecurityDomainContextAdaptor.java (https://github.com/kylape/jboss-as.git) Java · 121 lines
70 @Override
71 public void pushSubjectContext(final Subject subject, final Principal principal, final Object credential) {
72 AccessController.doPrivileged(new PrivilegedAction<Void>() {
74 public Void run() {
91 */
92 private static SecurityContext createSecurityContext(final String domain) {
93 return AccessController.doPrivileged(new PrivilegedAction<SecurityContext>() {
95 @Override
98 return SecurityContextFactory.createSecurityContext(domain);
99 } catch (Exception e) {
100 throw new RuntimeException(e);
101 }
102 }
RepositoryBackupTest.java (https://github.com/kbachl/modeshape.git) Java · 127 lines
53 boolean print = true;
55 createSubgraph(session, "/", depth, breadth, properties, false, new Stopwatch(), print ? System.out : null, null);
56 // session.save();
57 }
61 @Before
62 public void setUp() throws Exception {
63 testDirectory = new File("target/backupArea/backupTests");
64 FileUtil.delete(testDirectory);
65 }
114 problems.set(backupProblems);
115 } catch (RepositoryException e) {
116 throw new RuntimeException(e);
117 }
118 sw.stop();
Location.java (https://bitbucket.org/yossi_gil/services.git) Java · 201 lines
66 * InputResource to which this locations belongs
67 * @param t
68 * a token with the positioning information to initialize the newly
69 * created {@link Location}
70 */
79 /**
80 * Create a new {@link Location} object
81 *
82 * @param inputResource
146 return sb.toString();
147 } catch (IOException e) {
148 throw new RuntimeException(e);
149 }
150 }
LazyUser.java (https://bitbucket.org/YeahXD/hot6_memory.git) Java · 439 lines
ReprojectingIterator.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 139 lines
106 return reproject(feature);
107 } catch (IOException e) {
108 throw new RuntimeException(e);
109 }
110 }
124 String msg = "Error occured transforming "
125 + geometry.toString();
126 throw (IOException) new IOException(msg).initCause(e);
127 }
128 }
133 } catch (IllegalAttributeException e) {
134 String msg = "Error creating reprojeced feature";
135 throw (IOException) new IOException(msg).initCause(e);
136 }
137 }
LoadDataChange.java (https://github.com/geriBatai/liquibase.git) Java · 250 lines
161 return statements.toArray(new SqlStatement[statements.size()]);
162 } catch (IOException e) {
163 throw new RuntimeException(e);
164 } finally {
165 if (null != reader) {
176 ResourceAccessor opener = getResourceAccessor();
177 if (opener == null) {
178 throw new UnexpectedLiquibaseException("No file opener specified for "+getFile());
179 }
180 InputStream stream = opener.getResourceAsStream(getFile());
237 return CheckSum.compute(stream);
238 } catch (IOException e) {
239 throw new RuntimeException(e);
240 } finally {
241 if (stream != null) {
ChukwaRecordKey.java (https://github.com/haitaoyao/HiTune.git) Java · 269 lines
8 private static int[] _rio_rtiFilterFields;
9 static {
10 _rio_recTypeInfo = new org.apache.hadoop.record.meta.RecordTypeInfo(
11 "ChukwaRecordKey");
12 _rio_recTypeInfo.addField("reduceType",
205 return (os - s);
206 } catch (java.io.IOException e) {
207 throw new RuntimeException(e);
208 }
209 }
253 return (os1 - s1);
254 } catch (java.io.IOException e) {
255 throw new RuntimeException(e);
256 }
257 }
BaseTemplate.java (https://github.com/hsablonniere/play.git) Java · 118 lines
24 public String compiledSource;
25 public Map<Integer, Integer> linesMatrix = new HashMap<Integer, Integer>();
26 public Set<Integer> doBodyLines = new HashSet<Integer>();
45 directLoad(code);
46 } catch (Exception e) {
47 throw new RuntimeException("Cannot load precompiled template " + name);
48 }
49 }
72 if (stackTraceElement.getClassName().equals(compiledTemplateName) || stackTraceElement.getClassName().startsWith(compiledTemplateName + "$_run_closure")) {
73 if (doBodyLines.contains(stackTraceElement.getLineNumber())) {
74 throw new DoBodyException(e);
75 } else if (e instanceof TagInternalException) {
76 throw (TagInternalException) cleanStackTrace(e);
91 }
92 }
93 throw new RuntimeException(e);
94 }
ShadowContext.java (https://github.com/shazam/robolectric.git) Java · 201 lines
37 public File getDir(String name, int mode) {
38 // TODO: honor operating mode.
39 File file = new File(FILES_DIR, name);
40 if (!file.exists()) {
41 file.mkdir();
74 @Implementation
75 public final TypedArray obtainStyledAttributes(AttributeSet set, int[] attrs) {
76 TypedArray result = Robolectric.newInstanceOf(TypedArray.class);
77 if (attrs == null) {
78 return result;
196 return tmp;
197 } catch (IOException e) {
198 throw new RuntimeException(e);
199 }
200 }
CommonDeployableContainer.java (https://bitbucket.org/cprenzberg/wildfly.git) Java · 173 lines
69 @Override
70 public ProtocolDescription getDefaultProtocol() {
71 return new ProtocolDescription("jmx-as7");
72 }
92 getCallbackHandler());
93 } catch (UnknownHostException e) {
94 throw new RuntimeException(e);
95 }
97 ManagementClient client = new ManagementClient(modelControllerClient, containerConfig.getManagementAddress(), containerConfig.getManagementPort(), containerConfig.getManagementProtocol());
98 managementClient.set(client);
TransactionRetryStrategy.java (https://github.com/pangloss/blueprints.git) Java · 179 lines
33 } catch (Exception e) {
34 graph.rollback();
35 throw new RuntimeException(e);
36 }
70 public DelayedRetry(final int tries, final long delayBetweenRetry) {
71 this(tries, delayBetweenRetry, new HashSet<Class>());
72 }
97 public ExponentialBackoff(final int tries, final long initialDelay) {
98 this(tries, initialDelay, new HashSet<Class>());
99 }
ExecutionEnvironmentUtils.java (https://github.com/oberlies/tycho.git) Java · 129 lines
38 Properties listProps = readProperties(findInSystemBundle("profile.list"));
39 String[] profileFiles = listProps.getProperty("java.profiles").split(",");
40 Map<String, StandardExecutionEnvironment> envMap = new LinkedHashMap<String, StandardExecutionEnvironment>();
41 for (String profileFile : profileFiles) {
42 Properties props = readProperties(findInSystemBundle(profileFile.trim()));
53 listProps.load(stream);
54 } catch (IOException e) {
55 throw new RuntimeException(e);
56 } finally {
57 try {
60 }
61 } catch (IOException e) {
62 throw new RuntimeException(e);
63 }
64 }
IncrementalStateManager.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 151 lines
40 public static boolean recordIncrementalStates = false;
41 public static boolean debugIncrementalStates = false;
42 private static Hashtable incrementalStates = new Hashtable();
44 public static void recordSuccessfulBuild(String buildConfig, AjState state) {
62 try {
63 AjState state = (AjState) entry.getValue();
64 CompressingDataOutputStream dos = new CompressingDataOutputStream(new FileOutputStream(f));
65 state.write(dos);
66 dos.close();
67 } catch (FileNotFoundException e) {
68 throw new RuntimeException(e);
69 } catch (IOException e) {
70 throw new RuntimeException(e);
ReactorScheduledExecutorService.java (https://github.com/elasticsearch/elasticsearch.git) Java · 181 lines
53 decorateCallable(callable).call();
54 } catch (Exception e) {
55 throw new RuntimeException(e);
56 }
57 }, new TimeValue(delay, unit), executorName);
59 return new ReactorFuture<>(schedule);
60 }
62 public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
63 Runnable decoratedCommand = decorateRunnable(command);
64 Scheduler.ScheduledCancellable schedule = threadPool.schedule(decoratedCommand, new TimeValue(delay, unit), executorName);
65 return new ReactorFuture<>(schedule);
94 Runnable decorateRunnable = decorateRunnable(command);
96 Scheduler.Cancellable cancellable = threadPool.scheduleWithFixedDelay(decorateRunnable, new TimeValue(delay, unit), executorName);
98 return new ReactorFuture<>(cancellable);
PageHistory.java (https://github.com/dleonard0/fitnesse.git) Java · 250 lines
12 public class PageHistory {
13 private SimpleDateFormat dateFormat = new SimpleDateFormat(XmlFormatter.TEST_RESULT_FILE_DATE_PATTERN);
14 private int failures = 0;
15 private int passes = 0;
18 private int maxAssertions = 0;
19 private BarGraph barGraph;
20 private final HashMap<Date, PageTestSummary> summaryMap = new HashMap<Date, PageTestSummary>();
22 public PageHistory(File pageDirectory) {
24 compileHistoryFromPageDirectory(pageDirectory);
25 } catch (Exception e) {
26 throw new RuntimeException(e);
27 }
28 }
SimpleQueueResourceAdapter.java (https://github.com/jocstar/jboss-as.git) Java · 125 lines
50 transactionSupport = TransactionSupport.TransactionSupportLevel.NoTransaction)
51 public class SimpleQueueResourceAdapter implements ResourceAdapter {
52 private static final BlockingQueue<String> queue = new LinkedBlockingDeque<String>();
53 private static WorkManager workManager;
54 private static List<MessageEndpointFactory> endpointFactories = new LinkedList<MessageEndpointFactory>();
57 public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
58 if (workManager != null)
59 throw new ResourceAdapterInternalException("Can only start once");
60 workManager = ctx.getWorkManager();
61 }
79 process();
80 } catch (UnavailableException e) {
81 throw new RuntimeException(e);
82 }
83 }
HgPromptCommandExecutor.java (https://github.com/JetBrains/intellij-community.git) Java · 122 lines
30 @NotNull final String operation,
31 @Nullable final List<String> arguments) {
32 SocketServer promptServer = new SocketServer(new PromptReceiver(new HgDeleteModifyPromptHandler()));
33 try {
34 int promptPort = promptServer.start();
47 private List<String> prepareArguments(List<String> arguments, int port) {
48 List<String> cmdArguments = new ArrayList<>();
49 cmdArguments.add("--config");
50 cmdArguments.add("extensions.hg4ideapromptextension=" + myVcs.getPromptHooksExtensionFile().getAbsolutePath());
107 catch (InvocationTargetException e) {
108 //shouldn't happen
109 throw new RuntimeException(e);
110 }
111 }
WebAppTests.java (https://github.com/Beckham007/hadoop-common.git) Java · 172 lines
55 final T impl,
56 final Module... modules) {
57 return Guice.createInjector(new AbstractModule() {
58 final PrintWriter writer = spy(new PrintWriter(System.out));
96 return res;
97 } catch (Exception e) {
98 throw new WebAppException(e);
99 }
100 }
113 res.getWriter().flush();
114 } catch (Exception e) {
115 throw new RuntimeException(e);
116 }
117 }
125 return injector;
126 } catch (Exception e) {
127 throw new WebAppException(e);
128 }
129 }
EOJoin.java (https://github.com/bluepimento/openflexo.git) Java · 305 lines
49 */
50 public static EOJoin createJoinFromMap(Map<Object, Object> map, EORelationship relationship) {
51 EOJoin join = new EOJoin(relationship);
52 join.setOriginalMap(map);
53 return join;
158 setSourceAttribute(att);
159 } catch (Exception e) {
160 throw new RuntimeException(e);
161 }
162 } else {
177 } catch (Exception e) {
178 throw new RuntimeException(e);
179 }
180 } else {
CorbaSystemUser.java (https://github.com/OwlSoft/Owl.git) Java · 235 lines
Security.java (https://gitlab.com/manoj-makkuboy/JamsMusicPlayer) Java · 134 lines
91 return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey));
92 } catch (NoSuchAlgorithmException e) {
93 throw new RuntimeException(e);
94 } catch (InvalidKeySpecException e) {
95 Log.e(TAG, "Invalid key specification.");
96 throw new IllegalArgumentException(e);
97 } catch (Base64DecoderException e) {
98 Log.e(TAG, "Base64 decoding failed.");
99 throw new IllegalArgumentException(e);
100 }
101 }
Discover.java (https://gitlab.com/praveen235/javaproject) Java · 268 lines
106 return new MultiIterator<T>(list);
107 } catch (Throwable t) {
108 throw new RuntimeException(t);
109 }
110 }
146 } else {
147 Class<T> _class = getClass(loader, spec);
148 Class<?>[] types = new Class<?>[args != null ? args.length : 0];
149 if (args != null) {
150 for (int n = 0; n < args.length; n++) {
169 } catch (ClassNotFoundException e1) {
170 // throw the original exception
171 throw new RuntimeException(e);
172 }
173 }
ImportUtil.java (https://bitbucket.org/smitdevel/delta.git) Java · 295 lines
145 return datetime == null || datetime.isEmpty() || TEXT_NULL.equals(datetime) ? null : dateFormat.parse(datetime);
146 } catch (ParseException e) {
147 throw new RuntimeException(e);
148 }
149 }
280 public static CsvReader createDataReader(File logFile) throws FileNotFoundException {
281 CsvReader reader = new CsvReader(new BufferedInputStream(new FileInputStream(logFile)), ';', CHARSET_UTF8);
282 reader.setTrimWhitespace(true);
283 reader.setSkipEmptyRecords(true);
287 public static CsvReader createLogReader(File logFile) throws FileNotFoundException {
288 return new CsvReader(new BufferedInputStream(new FileInputStream(logFile)), ';', CHARSET_UTF8);
289 }
DefaultManyToOneRelation.java (https://bitbucket.org/cprenzberg/resteasy.git) Java · 310 lines
StaticMethodExpr.java (https://github.com/GEFFROY/Quercus.git) Java · 265 lines
83 throw e;
84 } catch (Exception e) {
85 throw new RuntimeException(e);
86 // log.log(Level.FINE, e.toString(), e);
87 }
97 Class []param = _method.getParameterTypes();
99 _marshall = new Marshall[param.length];
101 for (int i = 0; i < _marshall.length; i++) {
137 if (args.length > 0) {
138 objs = new Object[args.length];
140 for (int i = 0; i < _marshall.length; i++)
AbstractCGFile.java (https://github.com/bluepimento/openflexo.git) Java · 131 lines
PolygonSymbolizerImpl.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 241 lines
42 private DisplacementImpl disp;
44 private Fill fill = new FillImpl();
45 private StrokeImpl stroke = new StrokeImpl();
47 /**
48 * Creates a new instance of DefaultPolygonStyler
49 */
50 protected PolygonSymbolizerImpl() {
163 }
164 } catch (CloneNotSupportedException e) {
165 throw new RuntimeException(e); // this should never happen.
166 }
221 else if( symbolizer instanceof org.opengis.style.PolygonSymbolizer ){
222 org.opengis.style.PolygonSymbolizer polygonSymbolizer = (org.opengis.style.PolygonSymbolizer) symbolizer;
223 PolygonSymbolizerImpl copy = new PolygonSymbolizerImpl();
224 copy.setStroke( StrokeImpl.cast(polygonSymbolizer.getStroke()));
225 copy.setDescription( polygonSymbolizer.getDescription() );
JobOrderService.java (https://github.com/lukaspili/Ramses.git) Java · 127 lines
33 public void createOrder(List<Prestation> prestations, List<SoeExam> soeExams, List<SpecificPrestation> specificPrestations, User user) {
35 JobOrder order = new JobOrder();
36 order.creationDate = new LocalDate();
79 try {
80 File folder = new File("pdf/orders");
81 folder.mkdirs();
83 File file = File.createTempFile("order", ".pdf");
84 new JobOrderPdfGenerator().generate(order, file);
86 order.pdf = new S3RealBlob();
89 } catch (IOException e) {
90 throw new RuntimeException(e);
91 }
HexRead.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 191 lines
66 try
67 {
68 StringBuffer sectionText = new StringBuffer();
69 boolean inSection = false;
70 int c = stream.read();
79 case '\r':
80 inSection = false;
81 sectionText = new StringBuffer();
82 break;
83 case ']':
100 public static byte[] readData( String filename, String section ) throws IOException
101 {
102 File file = new File( filename );
103 FileInputStream stream = new FileInputStream( file );
177 return readData(new ByteArrayInputStream( data.getBytes() ), -1);
178 } catch (IOException e) {
179 throw new RuntimeException(e);
180 }
181 }
PropertyFormatter.java (https://github.com/wburns/infinispan.git) Java · 140 lines
SerializableException.java (https://github.com/VoltDB/voltdb.git) Java · 283 lines
110 @Override
111 protected SerializableException deserializeException(ByteBuffer b) {
112 return new MispartitionedException(b);
113 }
114 },
122 @Override
123 protected SerializableException deserializeException(ByteBuffer b) {
124 return new DRTableNotFoundException(b);
125 }
126 },
158 m_message = new String(messageBytes, "UTF-8");
159 } catch (UnsupportedEncodingException e) {
160 throw new RuntimeException(e);
161 }
162 }
CompilerInvoker.java (https://github.com/dpj/DPJizer.git) Java · 138 lines
64 astList = comp.parseFiles(javaFileObjects);
65 } catch (IOException e) {
66 throw new RuntimeException(e);
67 }
68 if (astList == null)
69 throw new RuntimeException("The ast list is null.");
70 for (JCCompilationUnit compilationUnit : astList) {
71 if (compilationUnit == null)
72 throw new RuntimeException("A returned AST is null.");
73 }
74 return astList;
Client.java (https://bitbucket.org/cairomax/labreti-broker.git) Java · 239 lines
48 user = InetAddress.getLocalHost().getHostAddress();
49 } catch (UnknownHostException e) {
50 throw new RuntimeException(e);
51 }
52 }
152 availableResources.get()));
153 } catch (RemoteException e) {
154 throw new RuntimeException(e);
155 }
156 }
176 wereTaken ? "taken!" : "NOT available!"));
177 } catch (RemoteException e) {
178 throw new RuntimeException(e);
179 }
WeekendCalendarImpl.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 248 lines
33 private final FramerImpl myFramer = new FramerImpl(Calendar.DAY_OF_WEEK);
35 private DayType[] myTypes = new DayType[7];
37 private int myWeekendDaysCount;
119 Date workingUnitStart = getStateChangeDate(unitStart, timeUnit,
120 false, true);
121 result.add(new CalendarActivityImpl(unitStart,
122 workingUnitStart, false));
123 unitStart = workingUnitStart;
231 opener.load(calendar.openStream());
232 } catch (Exception e) {
233 throw new RuntimeException(e);
234 }
235 }
QueryTest.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 176 lines
GoogleCalendarUtils.java (https://github.com/michelpohle/jbpm.git) Java · 80 lines
56 // } catch (IOException e) {
57 // e.printStackTrace();
58 // throw new RuntimeException(e);
59 // }
60 // }
71 // } catch (MalformedURLException e) {
72 // e.printStackTrace();
73 // throw new RuntimeException(e);
74 // } catch (IOException e) {
75 // e.printStackTrace();
76 // throw new RuntimeException(e);
77 // }
78 // }
RaptorState.java (https://github.com/barbeau/OpenTripPlanner.git) Java · 172 lines
86 cur = cur.parent;
87 }
88 return "(" + routes + ") at " + new Date(((long) arrivalTime) * 1000);
89 } else {
90 return "at " + stop + " boarded at " + boardStop + " on " + route + " time "
91 + new Date(((long) arrivalTime) * 1000) + " walkDistance " + walkDistance;
92 }
93 }
149 return (RaptorState) super.clone();
150 } catch (CloneNotSupportedException e) {
151 throw new RuntimeException(e);
152 }
153 }
CoinStore.java (https://github.com/coltnz/robonobo.git) Java · 138 lines
44 decryptCipher.init(Cipher.DECRYPT_MODE, sekritKey);
45 } catch (Exception e) {
46 throw new RuntimeException(e);
47 }
48 // Load coins from dir
57 CoinMsg coin = loadCoinFromFile(coinFile.getName());
58 if(!coinIds.containsKey(coin.getDenom()))
59 coinIds.put(coin.getDenom(), new LinkedList<String>());
60 coinIds.get(coin.getDenom()).add(coin.getCoinId().toString());
61 coinVal += getDenomValue(coin.getDenom());
99 private void saveCoinToFile(CoinMsg coin) throws IOException, GeneralSecurityException {
100 byte[] encArr = encryptCipher.doFinal(coin.toByteArray());
101 File file = new File(storageDir, coin.getCoinId().toString());
102 FileOutputStream fos = new FileOutputStream(file);
109 File file = new File(storageDir, coinId);
110 FileInputStream fis = new FileInputStream(file);
111 byte[] readArr = new byte[1024];
PropertyParser.java
(https://jedit.svn.sourceforge.net/svnroot/jedit)
Java · 485 lines
✨ Summary
This is a Java implementation of a parser generator tool, likely ANTLR. It defines a grammar for parsing and generates code to parse input strings according to that grammar. The code includes classes for tokenization, error handling, and recursive descent parsing. It appears to be part of a larger system for generating parsers from grammars.
This is a Java implementation of a parser generator tool, likely ANTLR. It defines a grammar for parsing and generates code to parse input strings according to that grammar. The code includes classes for tokenization, error handling, and recursive descent parsing. It appears to be part of a larger system for generating parsers from grammars.
69 public Location createEndLocation(Token t) {
70 if (t == null)
71 return new Location(0, 0);
72 return new Location(t.endLine, t.endColumn);
239 }
240 public PropertyParser(java.io.InputStream stream, String encoding) {
241 try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
242 token_source = new PropertyParserTokenManager(jj_input_stream);
245 jj_gen = 0;
246 for (int i = 0; i < 3; i++) jj_la1[i] = -1;
247 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
248 }
252 }
253 public void ReInit(java.io.InputStream stream, String encoding) {
254 try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
255 token_source.ReInit(jj_input_stream);
256 token = new Token();