id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
47,801
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final int[][] data = dst.getIntDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
47,802
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
47,803
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final float[][] data = dst.getFloatDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
47,804
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
47,805
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final double[][] data = dst.getDoubleDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
47,806
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
47,807
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_();
sink.lineBreak(); sink.section1_();
47,808
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
47,809
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
47,810
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
47,811
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
47,812
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
47,813
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
47,814
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG> public String error404() { return "/error/404"; }
public class ErrorController { @RequestMapping(value = {"/404"})
47,815
super(StringUtil.getUnqualifiedMemberName(constructor.getName())); this.constructorToString = constructor.toString(); this.metaClass = methodClass; returnType = Void.TYPE; paramTypes = Arrays.asList(constructor.getParameterTypes()); <BUG>modifier = constructor.getModifiers(); if (DEBUG_MEMBER_CREATION)</BUG> { logger.debug("Created MetaConstructor: {}", toString()); }
isVarArgs = constructor.isVarArgs(); if (DEBUG_MEMBER_CREATION)
47,816
} public static final boolean DEBUG_LOGGING = false; public static final boolean DEBUG_LOGGING_BYTECODE = false; public static final boolean DEBUG_LOGGING_CLASSPATH = false; public static final boolean DEBUG_LOGGING_ASSEMBLY = false; <BUG>public static final boolean DEBUG_LOGGING_SIG_MATCH = false; public static final boolean DEBUG_LOGGING_OVC = false;</BUG> public static final boolean DEBUG_LOGGING_PARSE_DICTIONARY = false; public static final boolean DEBUG_LOGGING_TRIVIEW = false; public static final boolean DEBUG_LOGGING_TAGPROCESSOR = false;
public static final boolean DEBUG_LOGGING_METHOD_ID_MATCH = false; public static final boolean DEBUG_LOGGING_OVC = false;
47,817
public static final String ATTR_PROF_FACTOR = "prof_factor"; public static final String ATTR_ACTION = "action"; public static final String ATTR_COMMENT = "comment"; public static final String ATTR_ADDRESS = "address"; public static final String ATTR_PREALLOCATED = "preallocated"; <BUG>public static final String ALWAYS = "always"; public static final String NEVER = "never"; public static final String S_ENTITY_APOS = "&apos;";</BUG> public static final String S_ENTITY_LT = "&lt;";
public static final String BRANCH_TAKEN_ALWAYS = "always"; public static final String BRANCH_TAKEN_NEVER = "never"; public static final String BRANCH_TAKEN_MIN = "min"; public static final String BRANCH_TAKEN_MAX = "max"; public static final String S_ENTITY_APOS = "&apos;";
47,818
BytecodeInstruction currentInstruction = null; for (Tag child : children) { String name = child.getName(); Map<String, String> tagAttrs = child.getAttributes(); <BUG>if (DEBUG_LOGGING) </BUG> { logger.debug("Examining child tag {}", child); }
if (DEBUG_LOGGING_BYTECODE)
47,819
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.TAG_NMETHOD; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.TAG_PARSE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.TAG_PHASE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.TAG_FAILURE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.ATTR_REASON; <BUG>import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_REASON_STALE_TASK; import java.util.List;</BUG> import java.util.Map; import org.adoptopenjdk.jitwatch.model.Compilation; import org.adoptopenjdk.jitwatch.model.IMetaMember;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.S_NEWLINE; import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.DEBUG_LOGGING_METHOD_ID_MATCH; import java.util.List;
47,820
Map<String, String> methodTagAttributes = methodTag.getAttributes(); String klassID = methodTagAttributes.get(ATTR_HOLDER); Tag klassTag = parseDictionary.getKlass(klassID); if (klassTag != null) { <BUG>if (DEBUG_LOGGING) { logger.debug("klass tag: {}", klassTag.toString(false)); }</BUG> String klassAttrName = klassTag.getAttributes().get(ATTR_NAME);
if (DEBUG_LOGGING_METHOD_ID_MATCH) builder.append(String.format("klass tag: %s", klassTag.toString(false))).append(S_NEWLINE); }
47,821
if (member.getParamTypeNames().length == paramTypes.size()) { for (int pos = 0; pos < member.getParamTypeNames().length; pos++) { String memberParamType = member.getParamTypeNames()[pos]; <BUG>String tagParamType = paramTypes.get(pos); if (!memberParamType.equals(tagParamType))</BUG> { paramsMatch = false; break;
if (DEBUG_LOGGING_METHOD_ID_MATCH) builder.append(String.format("checking: %s/%s", memberParamType, tagParamType)).append(S_NEWLINE); } if (!memberParamType.equals(tagParamType))
47,822
else { paramsMatch = false; } result = nameMatches && klassMatches && returnMatches && paramsMatch; <BUG>if (DEBUG_LOGGING) { logger.debug("Matched name: {} klass: {} return: {} params: {}", nameMatches, klassMatches, returnMatches, paramsMatch); logger.debug("Matches member:{} = {}", member, result); }</BUG> }
[DELETED]
47,823
SModelReference reference = LanguageAspect.STRUCTURE.get(node.getConceptLanguage()); reference = reference.update(); return node.getModel().getUsedVersion(reference); } public static int getReferenceToNodeVersion(SNode node, SModelReference targetModelReference) { <BUG>if (targetModelReference == null) { //target model reference is nullable in postponed references return -1; }</BUG> return node.getModel().getUsedVersion(targetModelReference);
[DELETED]
47,824
import java.util.ArrayList; import java.util.List; import java.util.Map; import static org.zwobble.mammoth.internal.util.Maps.map; public class HtmlPathParser { <BUG>public static HtmlPath parse(TokenIterator<TokenType> tokens) { if (tokens.peekTokenType() == TokenType.BANG) { tokens.skip(TokenType.BANG);</BUG> return HtmlPath.IGNORE; } else {
if (tokens.trySkip(TokenType.SYMBOL, "!")) {
47,825
String separator = parseSeparator(tokens); return new HtmlPathElement(new HtmlTag(tagNames, attributes, !isFresh, separator)); } private static List<String> parseTagNames(TokenIterator<TokenType> tokens) { List<String> tagNames = new ArrayList<>(); <BUG>tagNames.add(tokens.nextValue(TokenType.IDENTIFIER)); while (tokens.peekTokenType() == TokenType.CHOICE) { tokens.skip();</BUG> tagNames.add(tokens.nextValue(TokenType.IDENTIFIER)); }
while (tokens.trySkip(TokenType.SYMBOL, "|")) {
47,826
tokens.skip(TokenType.IDENTIFIER, "separator"); }); if (isSeparator) { <BUG>tokens.skip(TokenType.OPEN_PAREN); String value = TokenParser.parseString(tokens); tokens.skip(TokenType.CLOSE_PAREN); return value;</BUG> } else { return ""; }
tokens.skip(TokenType.SYMBOL, "("); tokens.skip(TokenType.SYMBOL, ")"); return value;
47,827
ParseException.class, () -> new DocumentConverter().addStyleMap("p =>\np[style-name=] =>")); assertThat( exception.getMessage(), equalTo( <BUG>"error reading style map at line 2, character 14: expected token of type STRING but was of type CLOSE_SQUARE_BRACKET\n\n" + </BUG> "p[style-name=] =>\n" + " ^")); }
"error reading style map at line 2, character 14: expected token of type STRING but was of type SYMBOL\n\n" +
47,828
package org.zwobble.mammoth.internal.styles.parsing; public enum TokenType { WHITESPACE, IDENTIFIER, <BUG>CLASS_NAME, COLON, GREATER_THAN, ARROW, EQUALS, OPEN_PAREN, CLOSE_PAREN, OPEN_SQUARE_BRACKET, CLOSE_SQUARE_BRACKET,</BUG> STRING,
SYMBOL,
47,829
RegexTokeniser.rule(TokenType.CLOSE_PAREN, "\\)"), RegexTokeniser.rule(TokenType.OPEN_SQUARE_BRACKET, "\\["), RegexTokeniser.rule(TokenType.CLOSE_SQUARE_BRACKET, "\\]"),</BUG> RegexTokeniser.rule(TokenType.STRING, stringPrefix + "'"), RegexTokeniser.rule(TokenType.UNTERMINATED_STRING, stringPrefix), <BUG>RegexTokeniser.rule(TokenType.INTEGER, "([0-9]+)"), RegexTokeniser.rule(TokenType.CHOICE, "\\|"), RegexTokeniser.rule(TokenType.BANG, "!")</BUG> ) );
String stringPrefix = "'((?:\\.|[^'])*)"; RegexTokeniser<TokenType> tokeniser = new RegexTokeniser<>( TokenType.UNKNOWN, list( RegexTokeniser.rule(TokenType.IDENTIFIER, "([a-zA-Z][a-zA-Z0-9\\-]*)"), RegexTokeniser.rule(TokenType.CLASS_NAME, "(\\.(?:[a-zA-Z0-9\\-]|\\\\.)+)"), RegexTokeniser.rule(TokenType.SYMBOL, ":|>|=>|=|\\(|\\)|\\[|\\]|\\||!"), RegexTokeniser.rule(TokenType.WHITESPACE, "\\s+"), RegexTokeniser.rule(TokenType.INTEGER, "([0-9]+)")
47,830
public void unterminatedStringsAreTokenised() { assertTokens("'Tristan", isToken(TokenType.UNTERMINATED_STRING, "'Tristan")); } @Test public void arrowsAreTokenised() { <BUG>assertTokens("=>=>", isToken(TokenType.ARROW, "=>"), isToken(TokenType.ARROW, "=>")); </BUG> } @Test public void classesAreTokenised() {
assertTokens("=>=>", isToken(TokenType.SYMBOL, "=>"), isToken(TokenType.SYMBOL, "=>"));
47,831
public ReportElement getBase() { return base; } @Override public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException { <BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false); </BUG> base.print(document, pageStream, pageNo, x, y, width); pageStream.close();
PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
47,832
public PdfTextStyle(String config) { Assert.hasText(config); String[] split = config.split(","); Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000"); fontSize = Integer.parseInt(split[0]); <BUG>font = resolveStandard14Name(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG> } public int getFontSize() { return fontSize;
font = getFont(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));
47,833
package cc.catalysts.boot.report.pdf.elements; import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; import org.apache.pdfbox.pdmodel.PDPageContentStream; <BUG>import org.apache.pdfbox.pdmodel.font.PDFont; import org.slf4j.Logger;</BUG> import org.slf4j.LoggerFactory; import org.springframework.util.StringUtils; import java.io.IOException;
import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.Matrix; import org.slf4j.Logger;
47,834
addTextSimple(stream, textConfig, textX, nextLineY, ""); return nextLineY; } try { <BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText); </BUG> float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]); if (!underline) { addTextSimple(stream, textConfig, x, nextLineY, split[0]); } else {
String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
47,835
public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { try { stream.setFont(textConfig.getFont(), textConfig.getFontSize()); stream.setNonStrokingColor(textConfig.getColor()); stream.beginText(); <BUG>stream.newLineAtOffset(textX, textY); stream.showText(text);</BUG> } catch (Exception e) { LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage()); }
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY)); stream.showText(text);
47,836
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth(0.5F); stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset); </BUG> stream.stroke(); } catch (IOException e) {
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
47,837
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {</BUG> String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0)); StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
47,838
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
47,839
import java.util.LinkedHashMap; import java.util.Map; import java.util.stream.Stream; abstract class GraphSONModule extends TinkerPopJacksonModule { GraphSONModule(final String name) { <BUG>super(name); }</BUG> static final class GraphSONModuleV2d0 extends GraphSONModule { private static final Map<Class, String> TYPE_DEFINITIONS = Collections.unmodifiableMap( new LinkedHashMap<Class, String>() {{
} static final class GraphSONModuleV3d0 extends GraphSONModule {
47,840
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
47,841
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
47,842
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
47,843
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
47,844
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
47,845
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
47,846
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
47,847
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
47,848
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
47,849
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
47,850
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
47,851
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
47,852
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
47,853
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
47,854
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
47,855
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
47,856
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
47,857
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
47,858
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
47,859
import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.OptionUtils; <BUG>import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.base.VersionUtil;</BUG> import org.ops4j.pax.web.itest.base.client.CookieState; import org.ops4j.pax.web.itest.base.client.HttpTestClientFactory; import org.osgi.framework.Bundle;
import org.ops4j.pax.web.itest.base.TestConfiguration; import org.ops4j.pax.web.itest.base.VersionUtil;
47,860
mavenBundle("org.glassfish", "javax.el", "3.0.0"), mavenBundle("javax.enterprise", "cdi-api", "1.2"), mavenBundle("javax.interceptor", "javax.interceptor-api", "1.2"), mavenBundle("javax.validation", "validation-api", "1.1.0.Final")); } <BUG>public static Option httpClientBundles() { return composite( mavenBundle("commons-codec", "commons-codec").version(asInProject()), linkBundle("org.apache.httpcomponents.httpcore"), linkBundle("org.apache.httpcomponents.httpmime"), linkBundle("org.apache.httpcomponents.httpclient")); }</BUG> public static Option workspaceBundle(String groupId, String artifactId) {
[DELETED]
47,861
import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; <BUG>import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.base.VersionUtil;</BUG> import org.ops4j.pax.web.itest.base.client.HttpTestClientFactory; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException;
import org.ops4j.pax.web.itest.base.TestConfiguration; import org.ops4j.pax.web.itest.base.VersionUtil;
47,862
import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.OptionUtils; <BUG>import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.base.VersionUtil;</BUG> import org.ops4j.pax.web.itest.base.client.CookieState; import org.ops4j.pax.web.itest.base.client.HttpTestClientFactory; import org.osgi.framework.Bundle;
import org.ops4j.pax.web.itest.base.TestConfiguration; import org.ops4j.pax.web.itest.base.VersionUtil;
47,863
private Bundle installWarBundle; @Configuration public static Option[] configuration() { return OptionUtils.combine( configureJetty(), <BUG>mavenBundle().groupId("commons-codec").artifactId("commons-codec").versionAsInProject(), systemProperty("org.osgi.service.http.secure.enabled").value( "true"),</BUG> systemProperty("org.ops4j.pax.web.ssl.keystore").value(
systemProperty("org.osgi.service.http.secure.enabled").value("true"),
47,864
import org.apache.commons.lang3.StringUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; <BUG>import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.base.WaitCondition2;</BUG> import org.ops4j.pax.web.itest.base.assertion.BundleMatchers; import org.ops4j.pax.web.itest.base.client.HttpTestClientFactory; import org.ops4j.pax.web.resources.api.OsgiResourceLocator;
import org.ops4j.pax.web.itest.base.TestConfiguration; import org.ops4j.pax.web.itest.base.WaitCondition2;
47,865
mavenBundle().groupId("org.ops4j.pax.web").artifactId("pax-web-resources-extender").versionAsInProject(), mavenBundle().groupId("org.ops4j.pax.web").artifactId("pax-web-resources-jsf").versionAsInProject(), mavenBundle().groupId("org.ops4j.pax.web.samples").artifactId("jsf-resourcehandler-myfaces").versionAsInProject(), mavenBundle().groupId("org.ops4j.pax.web.samples").artifactId("jsf-resourcehandler-resourcebundle").versionAsInProject() ); <BUG>} @Configuration public Option[] config() { return combine(configureJetty(), configureMyfacesWithSamples());</BUG> }
[DELETED]
47,866
@RunWith(PaxExam.class) public class AuthenticationIntegrationTest extends ITestBase { private Bundle installWarBundle; @Configuration public static Option[] configure() { <BUG>return combine(configureJetty(), mavenBundle().groupId("commons-codec").artifactId("commons-codec").versionAsInProject() );</BUG> }
return configureJetty();
47,867
import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.OptionUtils; <BUG>import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.web.itest.base.VersionUtil;</BUG> import org.ops4j.pax.web.itest.base.client.CookieState; import org.ops4j.pax.web.itest.base.client.HttpTestClientFactory; import org.osgi.framework.Bundle;
import org.ops4j.pax.web.itest.base.TestConfiguration; import org.ops4j.pax.web.itest.base.VersionUtil;
47,868
mavenBundle().groupId("org.apache.felix") .artifactId("org.apache.felix.shell.tui") .version("1.4.1"), mavenBundle().groupId("org.apache.felix") .artifactId("org.apache.felix.webconsole") <BUG>.version("3.1.8"), mavenBundle("commons-codec", "commons-codec").version( asInProject())// ,</BUG> ); }
.artifactId("org.apache.felix.configadmin") .version("1.2.8"), .artifactId("org.apache.felix.shell") .version("1.4.2"), .version("3.1.8")
47,869
<BUG>package org.apache.commons.imaging.formats.ico; import java.awt.Dimension;</BUG> import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream;
import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_FORMAT; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_PIXEL_DENSITY; import static org.apache.commons.imaging.common.BinaryFunctions.read2Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.read4Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.readByte; import static org.apache.commons.imaging.common.BinaryFunctions.readBytes; import java.awt.Dimension;
47,870
import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.formats.bmp.BmpImageParser; import org.apache.commons.imaging.palette.PaletteFactory; import org.apache.commons.imaging.palette.SimplePalette; <BUG>import org.apache.commons.imaging.util.IoUtils; import static org.apache.commons.imaging.ImagingConstants.*; import static org.apache.commons.imaging.common.BinaryFunctions.*;</BUG> public class IcoImageParser extends ImageParser { private static final String DEFAULT_EXTENSION = ".ico";
[DELETED]
47,871
bitCount, compression, sizeImage, xPelsPerMeter, yPelsPerMeter, colorsUsed, colorsImportant); final int bitmapPixelsOffset = 14 + 56 + 4 * ((colorsUsed == 0 && bitCount <= 8) ? (1 << bitCount) : colorsUsed); final int bitmapSize = 14 + 56 + restOfFile.length; <BUG>final ByteArrayOutputStream baos = new ByteArrayOutputStream(bitmapSize); BinaryOutputStream bos = null; boolean canThrow = false; try { bos = new BinaryOutputStream(baos, ByteOrder.LITTLE_ENDIAN);</BUG> bos.write('B');
try (BinaryOutputStream bos = new BinaryOutputStream(baos, ByteOrder.LITTLE_ENDIAN)) {
47,872
bos.write4Bytes(greenMask); bos.write4Bytes(blueMask); bos.write4Bytes(alphaMask); bos.write(restOfFile); bos.flush(); <BUG>canThrow = true; } finally { IoUtils.closeQuietly(canThrow, bos);</BUG> } final ByteArrayInputStream bmpInputStream = new ByteArrayInputStream(baos.toByteArray());
[DELETED]
47,873
this.iconDatas = iconDatas; } } private ImageContents readImage(final ByteSource byteSource) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final FileHeader fileHeader = readFileHeader(is);
try (InputStream is = byteSource.getInputStream()) {
47,874
<BUG>package org.apache.commons.imaging.formats.dcx; import java.awt.Dimension;</BUG> import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream;
import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_FORMAT; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_PIXEL_DENSITY; import static org.apache.commons.imaging.common.BinaryFunctions.read4Bytes; import java.awt.Dimension;
47,875
import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.common.bytesource.ByteSourceInputStream; import org.apache.commons.imaging.formats.pcx.PcxConstants; import org.apache.commons.imaging.formats.pcx.PcxImageParser; <BUG>import org.apache.commons.imaging.util.IoUtils; import static org.apache.commons.imaging.ImagingConstants.*; import static org.apache.commons.imaging.common.BinaryFunctions.*;</BUG> public class DcxImageParser extends ImageParser { private static final String DEFAULT_EXTENSION = ".dcx";
[DELETED]
47,876
pw.println(); } } private DcxHeader readDcxHeader(final ByteSource byteSource) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final int id = read4Bytes("Id", is, "Not a Valid DCX File", getByteOrder());
try (InputStream is = byteSource.getInputStream()) {
47,877
final ByteSourceInputStream pcxSource = new ByteSourceInputStream( stream, null); final BufferedImage image = pcxImageParser.getBufferedImage( pcxSource, new HashMap<String, Object>()); images.add(image); <BUG>canThrow = true; } finally { IoUtils.closeQuietly(canThrow, stream);</BUG> } }
[DELETED]
47,878
<BUG>package org.apache.commons.imaging.formats.icns; import java.awt.Dimension;</BUG> import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream;
import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_FORMAT; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_VERBOSE; import static org.apache.commons.imaging.common.BinaryFunctions.read4Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.readBytes; import java.awt.Dimension;
47,879
import org.apache.commons.imaging.ImageReadException; import org.apache.commons.imaging.ImageWriteException; import org.apache.commons.imaging.common.BinaryOutputStream; import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.bytesource.ByteSource; <BUG>import org.apache.commons.imaging.util.IoUtils; import static org.apache.commons.imaging.ImagingConstants.*; import static org.apache.commons.imaging.common.BinaryFunctions.*;</BUG> public class IcnsImageParser extends ImageParser { static final int ICNS_MAGIC = IcnsType.typeAsInt("icns");
[DELETED]
47,880
this.icnsElements = icnsElements; } } private IcnsContents readImage(final ByteSource byteSource) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final IcnsHeader icnsHeader = readIcnsHeader(is);
try (InputStream is = byteSource.getInputStream()) {
47,881
<BUG>package org.apache.commons.imaging.formats.gif; import java.awt.Dimension;</BUG> import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException;
import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_FORMAT; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_VERBOSE; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_XMP_XML; import static org.apache.commons.imaging.common.BinaryFunctions.compareBytes; import static org.apache.commons.imaging.common.BinaryFunctions.printByteBits; import static org.apache.commons.imaging.common.BinaryFunctions.printCharQuad; import static org.apache.commons.imaging.common.BinaryFunctions.read2Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.readByte; import static org.apache.commons.imaging.common.BinaryFunctions.readBytes; import java.awt.Dimension;
47,882
import org.apache.commons.imaging.ImageFormats; import org.apache.commons.imaging.ImageInfo; import org.apache.commons.imaging.ImageParser; import org.apache.commons.imaging.ImageReadException; import org.apache.commons.imaging.ImageWriteException; <BUG>import org.apache.commons.imaging.common.BinaryOutputStream; import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.ImageBuilder;</BUG> import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.common.mylzw.MyLzwCompressor;
import org.apache.commons.imaging.common.ImageBuilder;
47,883
import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.common.mylzw.MyLzwCompressor; import org.apache.commons.imaging.common.mylzw.MyLzwDecompressor; import org.apache.commons.imaging.palette.Palette; import org.apache.commons.imaging.palette.PaletteFactory; <BUG>import org.apache.commons.imaging.util.IoUtils; import static org.apache.commons.imaging.ImagingConstants.*; import static org.apache.commons.imaging.common.BinaryFunctions.*;</BUG> public class GifImageParser extends ImageParser { private static final String DEFAULT_EXTENSION = ".gif";
[DELETED]
47,884
FormatCompliance.getDefault()); } private ImageContents readFile(final ByteSource byteSource, final boolean stopBeforeImageData, final FormatCompliance formatCompliance) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final GifHeaderInfo ghi = readHeader(is, formatCompliance);
try (InputStream is = byteSource.getInputStream()) {
47,885
os.close(); } @Override public String getXmpXml(final ByteSource byteSource, final Map<String, Object> params) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final FormatCompliance formatCompliance = null;
try (InputStream is = byteSource.getInputStream()) {
47,886
<BUG>package org.apache.commons.imaging.formats.bmp; import java.awt.Dimension;</BUG> import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException;
import static org.apache.commons.imaging.ImagingConstants.BUFFERED_IMAGE_FACTORY; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_FORMAT; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_PIXEL_DENSITY; import static org.apache.commons.imaging.ImagingConstants.PARAM_KEY_VERBOSE; import static org.apache.commons.imaging.common.BinaryFunctions.read2Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.read4Bytes; import static org.apache.commons.imaging.common.BinaryFunctions.readByte; import static org.apache.commons.imaging.common.BinaryFunctions.readBytes; import java.awt.Dimension;
47,887
import org.apache.commons.imaging.ImageInfo; import org.apache.commons.imaging.ImageParser; import org.apache.commons.imaging.ImageReadException; import org.apache.commons.imaging.ImageWriteException; import org.apache.commons.imaging.PixelDensity; <BUG>import org.apache.commons.imaging.common.BinaryOutputStream; import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.ImageBuilder;</BUG> import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.palette.PaletteFactory;
import org.apache.commons.imaging.common.ImageBuilder;
47,888
import org.apache.commons.imaging.common.ImageMetadata; import org.apache.commons.imaging.common.ImageBuilder;</BUG> import org.apache.commons.imaging.common.bytesource.ByteSource; import org.apache.commons.imaging.palette.PaletteFactory; import org.apache.commons.imaging.palette.SimplePalette; <BUG>import org.apache.commons.imaging.util.IoUtils; import static org.apache.commons.imaging.ImagingConstants.*; import static org.apache.commons.imaging.common.BinaryFunctions.*;</BUG> public class BmpImageParser extends ImageParser { private static final String DEFAULT_EXTENSION = ".bmp";
[DELETED]
47,889
public FormatCompliance getFormatCompliance(final ByteSource byteSource) throws ImageReadException, IOException { final boolean verbose = false; final FormatCompliance result = new FormatCompliance( byteSource.getDescription()); <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> readImageContents(is, result, verbose);
try (InputStream is = byteSource.getInputStream()) {
47,890
try { is = byteSource.getInputStream(); </BUG> readImageContents(is, result, verbose); <BUG>canThrow = true; } finally { IoUtils.closeQuietly(canThrow, is);</BUG> } return result; }
public FormatCompliance getFormatCompliance(final ByteSource byteSource) throws ImageReadException, IOException { final boolean verbose = false; final FormatCompliance result = new FormatCompliance( byteSource.getDescription()); try (InputStream is = byteSource.getInputStream()) {
47,891
return result; } @Override public BufferedImage getBufferedImage(final ByteSource byteSource, final Map<String, Object> params) throws ImageReadException, IOException { <BUG>InputStream is = null; boolean canThrow = false; try { is = byteSource.getInputStream(); </BUG> final BufferedImage ret = getBufferedImage(is, params);
try (InputStream is = byteSource.getInputStream()) {
47,892
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
47,893
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
47,894
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
47,895
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]
47,896
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash())); } if(type != ModificationType.ADD) {
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
47,897
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> import java.util.List; @MessageBundle(projectCode = "JBAS") public interface PatchMessages {
import org.jboss.logging.annotations.Cause; import java.io.IOException;
47,898
journals.add(result); result.setCloseListener(this); return result;</BUG> } <BUG>@Override public <T> Journal<T> reader(JournalMetadata<T> metadata, JournalKey<T> key) throws JournalException { Journal<T> reader = new Journal<>(metadata, key); journals.add(reader); reader.setCloseListener(this); return reader; } }</BUG>
public <T> JournalBulkWriter<T> bulkWriter(JournalMetadata<T> metadata, JournalKey<T> key) throws JournalException { JournalBulkWriter<T> writer = super.bulkWriter(metadata, key); journals.add(writer); writer.setCloseListener(this); return writer;
47,899
public <T> JournalBulkReader<T> bulkReader(JournalKey<T> key) throws JournalException { String name = key.path(); checkBlocked(name); JournalBulkReader<T> result = bulkReaders.get(name); if (result == null) { <BUG>result = new JournalBulkReader<>(getOrCreateMetadata(key), key); result.setCloseListener(this);</BUG> bulkReaders.put(name, result); journalList.add(result); }
result = super.bulkReader(key); result.setCloseListener(this);
47,900
public <T> JournalBulkReader<T> bulkReader(Class<T> clazz) throws JournalException { return bulkReader(new JournalKey<>(clazz)); } @Override public JournalBulkReader bulkReader(String location) throws JournalException { <BUG>return bulkReader(new JournalKey<>(location)); }</BUG> @Override public abstract void close(); public JournalConfiguration getConfiguration() {
public <T> JournalBulkReader<T> bulkReader(JournalKey<T> key) throws JournalException { return new JournalBulkReader<>(getOrCreateMetadata(key), key);