This file contains 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 abstract class ChannelDescriptor implements Transport { | |
protected Channel channel; | |
} | |
public abstract class BasePort extends ChannelDescriptor { | |
protected ServerSocketChannel channel; | |
} |
This file contains 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
@Override | |
protected FileItemInstance executeCall(Map<String, Object> inParams) throws DataAccessException { | |
String idStr = (String) inParams.get("i_id_str"); | |
RowMapper<FileItemInstance> rowMapper = new RowMapper<FileItemInstance>() { | |
@Override | |
public FileItemInstance mapRow(ResultSet rs, int rowNum) throws SQLException { | |
FileItem fileItem = new FileItem(); | |
fileItem.setSize(rs.getLong("size")); |
This file contains 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 static <T> void sort(List<T> l, | |
final {T, T=>Number} block) { | |
Collections.sort(l, new Comparator<T>() { | |
public int compare(T arg0, T arg1) { | |
return block.invoke(arg0, arg1); | |
} | |
} | |
} |
This file contains 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
class A { | |
private String b; | |
class B { | |
public void printB() { | |
System.out.println(b); | |
} | |
} | |
} |
This file contains 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
fileItemFinder.setDataSourceContext(new DataSourceContext<FileItem>() { | |
private final Iterator<FileItem> fileItemsIterator = fileItems.iterator(); | |
@Override | |
public FileItem getNext() { | |
return fileItemsIterator.next(); | |
} | |
@Override |
This file contains 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
String errorMessage = ((SQLException) e.getCause()).getMessage(); | |
if (errorMessage.startsWith("ERROR:")) { | |
if (errorMessage.substring(7).equals("User do not exists")) { | |
throw new UserNotFoundException(); | |
} else { | |
throw new RuntimeException(e.getMessage()); | |
} | |
} else { | |
throw e; | |
} |
This file contains 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
<http use-expressions="true"> | |
<custom-filter ref="guestAuthenticationFilter" after="ANONYMOUS_FILTER" /> | |
<custom-filter ref="usernamePasswordAuthenticationFilter" before="FORM_LOGIN_FILTER" /> | |
<intercept-url pattern="/static/**" filters="none" /> | |
<intercept-url pattern="/" access="permitAll" /> | |
<!-- upload urls --> |
This file contains 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
class ID3TagPrintService { | |
ID3TagReader id3tagReader; | |
public void printFileID3Tag(String fileName) { | |
ID3Tag id3tag = id3tagReader.read(new FileInputStream(filename)); | |
System.out.println("Version: " + id3tag.getVersion()); | |
} | |
public void setID3TagReader(ID3TagReader id3tagReader) { |
This file contains 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 ID3Tag { | |
private Short version=0; | |
private Byte flags=0; | |
private Integer size=0; | |
public ID3Tag(Short version, Byte flags, Integer size){ | |
this.version = version; | |
this.flags = flags; | |
this.size = size; | |
} |
This file contains 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
class ProcessingMethodCommand(object): | |
def execute(self): | |
return "ok" | |
class BuggyProcessingMethodCommand(object): | |
def execute(self): | |
raise Exception("ohsit") | |
class Transport(object): |