public class InnerNewExample {
private class Inner {};
public static void main (String ... args){
InnerNewExample obj = new InnerNewExample();
Inner innerObj = obj.new Inner();
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package core.modules.parser.itmo.schedule; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.apploidxxx.entity.queue; | |
import com.apploidxxx.entity.User; | |
import org.junit.Test; | |
import java.util.List; | |
import static org.junit.Assert.*; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadsExample implements Runnable { | |
static int counter = 1; // a global counter | |
static ReentrantLock counterLock = new ReentrantLock(true); // enable fairness policy | |
static void incrementCounter(){ | |
// Using ReenterantLock for avoid starvation problem | |
counterLock.lock(); | |
// Always good practice to enclose locks in a try-finally block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.apploidxxx</groupId> | |
<artifactId>helios-rest-api</artifactId> | |
<packaging>jar</packaging> | |
<version>1.5-SNAPSHOT</version> | |
<name>helios-rest-api</name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ...HibernateSessionFactoryUtil; | |
import org.hibernate.Session; | |
import org.hibernate.Transaction; | |
/** | |
* | |
* Базовые операции для DAO (CRUD без R) | |
* Необходимо настроить HibernateSessionFactoryUtil который может возвращать SessionFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mail; | |
import javax.mail.*; | |
import javax.mail.internet.InternetAddress; | |
import javax.mail.internet.MimeMessage; | |
import java.io.IOException; | |
import java.util.Properties; | |
/** | |
* @author Arthur Kupriyanov |
Hello World program in bytecode
cafe babe
0000 0034
001d
0a 0006 000f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package generics.with; | |
import java.lang.reflect.InvocationTargetException; | |
/** | |
* @author Arthur Kupriyanov | |
*/ | |
public class ClassMarkWithGenerics { | |
private <T> T getFoo(Class<T> tClass) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { | |
return tClass.getConstructor(String.class).newInstance("something init arg"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.apploidxxx.heliosrestapispring.api.util; | |
import com.apploidxxx.heliosrestapispring.api.exception.persistence.EntityNotFoundException; | |
import com.apploidxxx.heliosrestapispring.api.exception.persistence.InvalidAccessTokenException; | |
import com.apploidxxx.heliosrestapispring.api.exception.persistence.PersistenceException; | |
import com.apploidxxx.heliosrestapispring.entity.Session; | |
import com.apploidxxx.heliosrestapispring.entity.access.repository.SessionRepository; | |
import com.apploidxxx.heliosrestapispring.entity.access.repository.UserRepository; | |
import com.apploidxxx.heliosrestapispring.entity.access.repository.queue.QueueRepository; | |
import com.apploidxxx.heliosrestapispring.entity.queue.Queue; |