| Chunk |
|---|
| Conflicting content |
|---|
}
}
<<<<<<< HEAD:src/main/java/org/gjt/jclasslib/browser/BrowserTreePane.java
private void addElementValuePairEntry(BrowserTreeNode parentNode, AnnotationElementValue annotation) {
=======
private void addRuntimeTypeAnnotation(BrowserTreeNode parentNode,
RuntimeTypeAnnotationsAttribute structure) {
TypeAnnotationElementValue[] annotations = structure
.getRuntimeAnnotations();
if (annotations == null) {
return;
}
int annotationsCount = annotations.length;
for (int i = 0; i < annotationsCount; i++) {
addSingleTypeAnnotationNode(annotations[i], i, annotationsCount,
parentNode);
}
}
private void addSingleTypeAnnotationNode(
TypeAnnotationElementValue annotation, int index,
int attributesCount, BrowserTreeNode parentNode) {
if (annotation == null) {
parentNode.add(buildNullNode());
} else {
BrowserTreeNode entryNode = new BrowserTreeNode(getFormattedIndex(
index, attributesCount) + annotation.getEntryName(),
BrowserTreeNode.NODE_TYPE_ANNOTATION, index, annotation);
parentNode.add(entryNode);
addSingleAnnotationNode(annotation.getAnnotation(), 0, 1,
entryNode);
}
}
private void addBootstrapMethodAnnotation(BrowserTreeNode parentNode,
BootstrapMethodsAttribute structure) {
BootstrapMethodsEntry[] annotations = structure
.getMethods();
if (annotations == null) {
return;
}
int annotationsCount = annotations.length;
for (int i = 0; i < annotationsCount; i++) {
addSingleBootstrapMethodNode(annotations[i], i, annotationsCount,
parentNode);
}
}
private void addSingleBootstrapMethodNode(
BootstrapMethodsEntry annotation, int index,
int attributesCount, BrowserTreeNode parentNode) {
if (annotation == null) {
parentNode.add(buildNullNode());
} else {
String name = null;
try {
name = services.getClassFile().getConstantPool()[annotation.getMethodRefIndexIndex()].getVerbose();
} catch (InvalidByteCodeException e) {
e.printStackTrace();
name="UNKNOWN";
}
BrowserTreeNode entryNode = new BrowserTreeNode(getFormattedIndex(
index, attributesCount)+name,
}
}
BrowserTreeNode.BOOTSTRAP_METHOD_ANNOTATION, index, annotation);
parentNode.add(entryNode);
private void addElementValuePairEntry(BrowserTreeNode parentNode,
AnnotationElementValue annotation) {
>>>>>>> 0631259d6bdcaf40d613c740d4db897d603ec565:src/org/gjt/jclasslib/browser/BrowserTreePane.java
ElementValuePair[] entries = annotation.getElementValuePairEntries();
if (entries == null) { |
| Solution content |
|---|
}
}
private void addRuntimeTypeAnnotation(BrowserTreeNode parentNode,
RuntimeTypeAnnotationsAttribute structure) {
TypeAnnotationElementValue[] annotations = structure
.getRuntimeAnnotations();
if (annotations == null) {
return;
}
int annotationsCount = annotations.length;
for (int i = 0; i < annotationsCount; i++) {
addSingleTypeAnnotationNode(annotations[i], i, annotationsCount,
parentNode);
}
}
private void addSingleTypeAnnotationNode(
TypeAnnotationElementValue annotation, int index,
int attributesCount, BrowserTreeNode parentNode) {
if (annotation == null) {
parentNode.add(buildNullNode());
} else {
BrowserTreeNode entryNode = new BrowserTreeNode(getFormattedIndex(
index, attributesCount) + annotation.getEntryName(),
BrowserTreeNode.NODE_TYPE_ANNOTATION, index, annotation);
parentNode.add(entryNode);
addSingleAnnotationNode(annotation.getAnnotation(), 0, 1,
entryNode);
}
}
private void addBootstrapMethodAnnotation(BrowserTreeNode parentNode,
BootstrapMethodsAttribute structure) {
BootstrapMethodsEntry[] annotations = structure
.getMethods();
if (annotations == null) {
return;
}
int annotationsCount = annotations.length;
for (int i = 0; i < annotationsCount; i++) {
addSingleBootstrapMethodNode(annotations[i], i, annotationsCount,
parentNode);
}
}
private void addSingleBootstrapMethodNode(
BootstrapMethodsEntry annotation, int index,
int attributesCount, BrowserTreeNode parentNode) {
if (annotation == null) {
parentNode.add(buildNullNode());
} else {
String name = null;
try {
name = services.getClassFile().getConstantPool()[annotation.getMethodRefIndexIndex()].getVerbose();
} catch (InvalidByteCodeException e) {
e.printStackTrace();
name="UNKNOWN";
}
BrowserTreeNode entryNode = new BrowserTreeNode(getFormattedIndex(
index, attributesCount)+name,
BrowserTreeNode.BOOTSTRAP_METHOD_ANNOTATION, index, annotation);
parentNode.add(entryNode);
}
}
private void addElementValuePairEntry(BrowserTreeNode parentNode, AnnotationElementValue annotation) {
ElementValuePair[] entries = annotation.getElementValuePairEntries();
if (entries == null) { |
| File |
|---|
| BrowserTreePane.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Method declaration |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
private static final String SCREEN_LOCAL_VARIABLE_TYPE_TABLE = "LocalVariableTypeTable";
private static final String SCREEN_RUNTIME_ANNOTATIONS = "RuntimeAnnotations";
private static final String SCREEN_ANNOTATION_DEFAULT = "AnnotationDefault";
<<<<<<< HEAD:src/main/java/org/gjt/jclasslib/browser/detail/AttributeDetailPane.java
private HashMap |
| Solution content |
|---|
private static final String SCREEN_LOCAL_VARIABLE_TYPE_TABLE = "LocalVariableTypeTable";
private static final String SCREEN_RUNTIME_ANNOTATIONS = "RuntimeAnnotations";
private static final String SCREEN_ANNOTATION_DEFAULT = "AnnotationDefault";
private static final String SCREEN_BOOTSTRAP_METHODS = "BootstrapMethods";
private static final String SCREEN_STACK_MAP_TABLE = "StackMapTable";
private static final String SCREEN_METHOD_PARAMETERS = "MethodParameters";
private HashMap |
| File |
|---|
| AttributeDetailPane.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
<<<<<<< HEAD:src/main/java/org/gjt/jclasslib/browser/detail/ConstantPoolDetailPane.java
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the license, or (at your option) any later version.
*/
package org.gjt.jclasslib.browser.detail;
import org.gjt.jclasslib.browser.AbstractDetailPane;
import org.gjt.jclasslib.browser.BrowserServices;
import org.gjt.jclasslib.browser.BrowserTreeNode;
import org.gjt.jclasslib.browser.detail.constants.*;
import org.gjt.jclasslib.structures.CPInfo;
import org.gjt.jclasslib.structures.constants.*;
import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.util.HashMap;
/**
Detail pane showing constant pool entries. This class is a container for
the classes defined in the constants subpackage and switches between
the contained panes as required.
@author Ingo Kegel
*/
public class ConstantPoolDetailPane extends AbstractDetailPane {
private static final String SCREEN_CONSTANT_UTF8_INFO = "ConstantUtf8Info";
private static final String SCREEN_CONSTANT_UNKNOWN = "ConstantUnknown";
private static final String SCREEN_CONSTANT_CLASS_INFO = "ConstantClassInfo";
private static final String SCREEN_CONSTANT_DOUBLE_INFO = "ConstantDoubleInfo";
private static final String SCREEN_CONSTANT_LONG_INFO = "ConstantLongInfo";
private static final String SCREEN_CONSTANT_FLOAT_INFO = "ConstantFloatInfo";
private static final String SCREEN_CONSTANT_INTEGER_INFO = "ConstantIntegerInfo";
private static final String SCREEN_CONSTANT_NAME_AND_TYPE_INFO = "ConstantNameAndTypeInfo";
private static final String SCREEN_CONSTANT_STRING_INFO = "ConstantStringInfo";
private static final String SCREEN_CONSTANT_REFERENCE = "ConstantReference";
private static final String SCREEN_CONSTANT_INVOKE_DYNAMIC = "ConstantInvokeDynamic";
private static final String SCREEN_CONSTANT_METHOD_HANDLE = "ConstantMethodHandle";
private static final String SCREEN_CONSTANT_METHOD_TYPE = "ConstantMethodType";
private HashMap |
| Solution content |
|---|
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the license, or (at your option) any later version.
*/
package org.gjt.jclasslib.browser.detail;
import org.gjt.jclasslib.browser.AbstractDetailPane;
import org.gjt.jclasslib.browser.BrowserServices;
import org.gjt.jclasslib.browser.BrowserTreeNode;
import org.gjt.jclasslib.browser.detail.constants.*;
import org.gjt.jclasslib.structures.CPInfo;
import org.gjt.jclasslib.structures.constants.*;
import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.util.HashMap;
/**
Detail pane showing constant pool entries. This class is a container for
the classes defined in the constants subpackage and switches between
the contained panes as required.
@author Ingo Kegel
*/
public class ConstantPoolDetailPane extends AbstractDetailPane {
private static final String SCREEN_CONSTANT_UTF8_INFO = "ConstantUtf8Info";
private static final String SCREEN_CONSTANT_UNKNOWN = "ConstantUnknown";
private static final String SCREEN_CONSTANT_CLASS_INFO = "ConstantClassInfo";
private static final String SCREEN_CONSTANT_DOUBLE_INFO = "ConstantDoubleInfo";
private static final String SCREEN_CONSTANT_LONG_INFO = "ConstantLongInfo";
private static final String SCREEN_CONSTANT_FLOAT_INFO = "ConstantFloatInfo";
private static final String SCREEN_CONSTANT_INTEGER_INFO = "ConstantIntegerInfo";
private static final String SCREEN_CONSTANT_NAME_AND_TYPE_INFO = "ConstantNameAndTypeInfo";
private static final String SCREEN_CONSTANT_STRING_INFO = "ConstantStringInfo";
private static final String SCREEN_CONSTANT_REFERENCE = "ConstantReference";
private static final String SCREEN_CONSTANT_INVOKE_DYNAMIC = "ConstantInvokeDynamic";
private static final String SCREEN_CONSTANT_METHOD_HANDLE = "ConstantMethodHandle";
private static final String SCREEN_CONSTANT_METHOD_TYPE = "ConstantMethodType";
private HashMap |
| File |
|---|
| ConstantPoolDetailPane.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Class declaration |
| Comment |
| Import |
| Package declaration |
| Chunk |
|---|
| Conflicting content |
|---|
private void checkMajorVersion(int majorVersion) {
if (majorVersion < 45 || majorVersion > 52) {
<<<<<<< HEAD:src/main/java/org/gjt/jclasslib/structures/ClassFile.java
Log.warning("major version should be between 45 and 51 for JDK <= 1.8, was " + majorVersion);
=======
Log.warning("major version should be between 45 and 52 for JDK <= 1.8");
>>>>>>> 0631259d6bdcaf40d613c740d4db897d603ec565:src/org/gjt/jclasslib/structures/ClassFile.java
}
} |
| Solution content |
|---|
private void checkMajorVersion(int majorVersion) {
if (majorVersion < 45 || majorVersion > 52) {
Log.warning("major version should be between 45 and 51 for JDK <= 1.8, was " + majorVersion);
}
} |
| File |
|---|
| ClassFile.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
<<<<<<< HEAD:src/main/java/org/gjt/jclasslib/structures/constants/ConstantMethodHandleInfo.java
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the license, or (at your option) any later version.
*/
package org.gjt.jclasslib.structures.constants;
import org.gjt.jclasslib.structures.CPInfo;
import org.gjt.jclasslib.structures.InvalidByteCodeException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
Describes a CONSTANT_MethodHandle_info constant pool data structure.
@author Hannes Kegel
*/
public class ConstantMethodHandleInfo extends CPInfo {
/** Length of the constant pool data structure in bytes. */
public static final int SIZE = 3;
public static final int TYPE_GET_FIELD = 1;
public static final int TYPE_GET_STATIC = 2;
public static final int TYPE_PUT_FIELD = 3;
public static final int TYPE_PUT_STATIC = 4;
public static final int TYPE_INVOKE_VIRTUAL = 5;
public static final int TYPE_INVOKE_STATIC = 6;
public static final int TYPE_INVOKE_SPECIAL = 7;
public static final int TYPE_NEW_INVOKE_SPECIAL = 8;
public static final int TYPE_INVOKE_INTERFACE = 9;
private int referenceIndex;
private int type;
public byte getTag() {
return CONSTANT_METHOD_HANDLE;
}
public String getTagVerbose() {
return CONSTANT_METHOD_HANDLE_VERBOSE;
}
public String getVerbose() throws InvalidByteCodeException {
return getName();
}
/**
Get the index of the constant pool entry containing the reference.
@return the index
*/
public int getReferenceIndex() {
return referenceIndex;
}
/**
Set the index of the constant pool entry containing the reference.
@param referenceIndex the index
*/
public void setReferenceIndex(int referenceIndex) {
this.referenceIndex = referenceIndex;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getTypeVerbose() {
switch (type) {
case TYPE_GET_FIELD:
return "REF_getField";
case TYPE_GET_STATIC:
return "REF_getStatic";
case TYPE_PUT_FIELD:
return "REF_putField";
case TYPE_PUT_STATIC:
return "REF_putStatic";
case TYPE_INVOKE_VIRTUAL:
return "REF_invokeVirtual";
case TYPE_INVOKE_STATIC:
return "REF_invokeStatic";
case TYPE_INVOKE_SPECIAL:
return "REF_invokeSpecial";
case TYPE_NEW_INVOKE_SPECIAL:
return "REF_newInvokeSpecial";
case TYPE_INVOKE_INTERFACE:
return "REF_invokeInterface";
default:
return "unknown value " + type;
}
}
/**
Get the descriptor.
@return the descriptor
@throws org.gjt.jclasslib.structures.InvalidByteCodeException if the byte code is invalid
*/
public String getName() throws InvalidByteCodeException {
return getTypeVerbose() + " " +
classFile.getConstantPoolEntryName(referenceIndex);
}
public void read(DataInput in)
throws InvalidByteCodeException, IOException {
type = in.readByte();
referenceIndex = in.readUnsignedShort();
if (debug) debug("read ");
}
public void write(DataOutput out)
throws InvalidByteCodeException, IOException {
out.writeByte(CONSTANT_METHOD_HANDLE);
out.write(type);
out.writeShort(referenceIndex);
if (debug) debug("wrote ");
}
public boolean equals(Object object) {
if (!(object instanceof ConstantMethodHandleInfo)) {
return false;
}
ConstantMethodHandleInfo constantMethodHandleInfo = (ConstantMethodHandleInfo)object;
return super.equals(object) && constantMethodHandleInfo.referenceIndex == referenceIndex && constantMethodHandleInfo.type == type;
}
public int hashCode() {
return super.hashCode() ^ referenceIndex;
}
protected void debug(String message) {
super.debug(message + getTagVerbose() + " with reference_index " + referenceIndex + " and type " + type);
}
}
=======
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the license, or (at your option) any later version.
*/
package org.gjt.jclasslib.structures.constants;
import org.gjt.jclasslib.structures.CPInfo;
import org.gjt.jclasslib.structures.InvalidByteCodeException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
Describes a CONSTANT_MethodHandle_info constant pool data structure.
@author Hannes Kegel
@version $Revision: 1.1 $ $Date: 2010-07-26 14:00:09 $
*/
public class ConstantMethodHandleInfo extends CPInfo {
/** Length of the constant pool data structure in bytes. */
public static final int SIZE = 3;
public static final int TYPE_GET_FIELD = 1;
public static final int TYPE_GET_STATIC = 2;
public static final int TYPE_PUT_FIELD = 3;
public static final int TYPE_PUT_STATIC = 4;
public static final int TYPE_INVOKE_VIRTUAL = 5;
public static final int TYPE_INVOKE_STATIC = 6;
public static final int TYPE_INVOKE_SPECIAL = 7;
public static final int TYPE_NEW_INVOKE_SPECIAL = 8;
public static final int TYPE_INVOKE_INTERFACE = 9;
private int referenceIndex;
private int type;
public byte getTag() {
return CONSTANT_METHOD_HANDLE;
}
public String getTagVerbose() {
return CONSTANT_METHOD_HANDLE_VERBOSE;
}
public String getVerbose() throws InvalidByteCodeException {
return getName();
}
/**
Get the index of the constant pool entry containing the reference.
@return the index
*/
public int getReferenceIndex() {
return referenceIndex;
}
/**
Set the index of the constant pool entry containing the reference.
@param referenceIndex the index
*/
public void setReferenceIndex(int referenceIndex) {
this.referenceIndex = referenceIndex;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
/**
Get the descriptor.
@return the descriptor
@throws org.gjt.jclasslib.structures.InvalidByteCodeException if the byte code is invalid
*/
public String getName() throws InvalidByteCodeException {
return classFile.getConstantPool()[referenceIndex].getVerbose();
}
public void read(DataInput in)
throws InvalidByteCodeException, IOException {
type = in.readByte();
referenceIndex = in.readUnsignedShort();
if (debug) debug("read ");
}
public void write(DataOutput out)
throws InvalidByteCodeException, IOException {
out.writeByte(CONSTANT_METHOD_HANDLE);
out.write(type);
out.writeShort(referenceIndex);
if (debug) debug("wrote ");
}
public boolean equals(Object object) {
if (!(object instanceof ConstantMethodHandleInfo)) {
return false;
}
ConstantMethodHandleInfo constantMethodHandleInfo = (ConstantMethodHandleInfo)object;
return super.equals(object) && constantMethodHandleInfo.referenceIndex == referenceIndex && constantMethodHandleInfo.type == type;
}
public int hashCode() {
return super.hashCode() ^ referenceIndex;
}
protected void debug(String message) {
super.debug(message + getTagVerbose() + " with reference_index " + referenceIndex + " and type " + type);
}
}
>>>>>>> 0631259d6bdcaf40d613c740d4db897d603ec565:src/org/gjt/jclasslib/structures/constants/ConstantMethodHandleInfo.java |
| Solution content |
|---|
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the license, or (at your option) any later version.
*/
package org.gjt.jclasslib.structures.constants;
import org.gjt.jclasslib.structures.CPInfo;
import org.gjt.jclasslib.structures.InvalidByteCodeException;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
/**
Describes a CONSTANT_MethodHandle_info constant pool data structure.
@author Hannes Kegel
*/
public class ConstantMethodHandleInfo extends CPInfo {
/** Length of the constant pool data structure in bytes. */
public static final int SIZE = 3;
public static final int TYPE_GET_FIELD = 1;
public static final int TYPE_GET_STATIC = 2;
public static final int TYPE_PUT_FIELD = 3;
public static final int TYPE_PUT_STATIC = 4;
public static final int TYPE_INVOKE_VIRTUAL = 5;
public static final int TYPE_INVOKE_STATIC = 6;
public static final int TYPE_INVOKE_SPECIAL = 7;
public static final int TYPE_NEW_INVOKE_SPECIAL = 8;
public static final int TYPE_INVOKE_INTERFACE = 9;
private int referenceIndex;
private int type;
public byte getTag() {
return CONSTANT_METHOD_HANDLE;
}
public String getTagVerbose() {
return CONSTANT_METHOD_HANDLE_VERBOSE;
}
public String getVerbose() throws InvalidByteCodeException {
return getName();
}
/**
Get the index of the constant pool entry containing the reference.
@return the index
*/
public int getReferenceIndex() {
return referenceIndex;
}
/**
Set the index of the constant pool entry containing the reference.
@param referenceIndex the index
*/
public void setReferenceIndex(int referenceIndex) {
this.referenceIndex = referenceIndex;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getTypeVerbose() {
switch (type) {
case TYPE_GET_FIELD:
return "REF_getField";
case TYPE_GET_STATIC:
return "REF_getStatic";
case TYPE_PUT_FIELD:
return "REF_putField";
case TYPE_PUT_STATIC:
return "REF_putStatic";
case TYPE_INVOKE_VIRTUAL:
return "REF_invokeVirtual";
case TYPE_INVOKE_STATIC:
return "REF_invokeStatic";
case TYPE_INVOKE_SPECIAL:
return "REF_invokeSpecial";
case TYPE_NEW_INVOKE_SPECIAL:
return "REF_newInvokeSpecial";
case TYPE_INVOKE_INTERFACE:
return "REF_invokeInterface";
default:
return "unknown value " + type;
}
}
/**
Get the descriptor.
@return the descriptor
@throws org.gjt.jclasslib.structures.InvalidByteCodeException if the byte code is invalid
*/
public String getName() throws InvalidByteCodeException {
return getTypeVerbose() + " " +
classFile.getConstantPoolEntryName(referenceIndex);
}
public void read(DataInput in)
throws InvalidByteCodeException, IOException {
type = in.readByte();
referenceIndex = in.readUnsignedShort();
if (debug) debug("read ");
}
public void write(DataOutput out)
throws InvalidByteCodeException, IOException {
out.writeByte(CONSTANT_METHOD_HANDLE);
out.write(type);
out.writeShort(referenceIndex);
if (debug) debug("wrote ");
}
public boolean equals(Object object) {
if (!(object instanceof ConstantMethodHandleInfo)) {
return false;
}
ConstantMethodHandleInfo constantMethodHandleInfo = (ConstantMethodHandleInfo)object;
return super.equals(object) && constantMethodHandleInfo.referenceIndex == referenceIndex && constantMethodHandleInfo.type == type;
}
public int hashCode() {
return super.hashCode() ^ referenceIndex;
}
protected void debug(String message) {
super.debug(message + getTagVerbose() + " with reference_index " + referenceIndex + " and type " + type);
}
} |
| File |
|---|
| ConstantMethodHandleInfo.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Class declaration |
| Comment |
| Import |
| Package declaration |